M=int(input()) s=[int(input())**2 for i in range(2**M)] n=2**M p=[1]*n for m in range(M-1): q=[0]*n for i in range(n): b=((i>>m)^1)<