N=int(input()) A=list(map(int,input().split())) B=[];C=[];p=1 for i in range(min(N,70)): B.append(A[i]) C.append(p) p*=2 p,q=0,0;D=[] for i in range(min(N,70)): a,b=B[i],C[i] for x,y in D: if a^x