template main(MAIN_BODY:untyped):untyped = import sequtils,strutils,strscans,algorithm,math,future,sets,queues,tables template get():string = stdin.readLine() template times(n:int,body:untyped): untyped = (for _ in 0..10 -> 4 proc ctz(n:int):cint{.importC: "__builtin_ctz", noDecl .} # 01<0000> -> 4 if isMainModule: MAIN_BODY main: let N = get().parseInt ws = get().split().map(parseInt) goal = ws.sum() div 2 if ws.sum() mod 2 == 1 : echo "impossible" quit() var dp = newSeqWith(goal+1,newSeqWith(N,false)) proc dfs(x,i:int):void = if dp[x][i]: return if x == 0 or (i == N-1 and x - ws[i] == 0): echo "possible" quit() if i == N - 1: dp[x][i] = true return if x - ws[i] >= 0: dfs(x - ws[i],i+1) dfs(x,i+1) dp[x][i] = true dfs(goal,0) echo "impossible"