All pastes #32rrphSest Raw Edit

text paste

public text v1 · immutable
#32rrphSest ·published 2026-07-04 15:06 UTC
rendered paste body
import sysdef solve():    raw = list(map(int, sys.stdin.read().split()))    if not raw:        return    n, c = raw[0], raw[1:]    for T in ((n - 1) - c[0], (n - 1) - c[0] + 1):        if 0 <= T <= n:            a, P = [], 0            for i, ci in enumerate(c, 1):                ai = ci + T - (n - i) - 2 * P                if ai not in (0, 1):                    break                a.append(ai)                P += ai            if len(a) == n and P == T:                print("possible\n" + "".join("><"[1 - x] for x in a))                return    print("impossible")solve()