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