N=int(input()) A=list(map(int,input().split())) ANS=0 for i in range(32): x=0 y=0 for a in A: if a & (1<