N=int(input()) A=list(map(int,input().split())) for i in range(61): if sum(A[j]>>i & 1 for j in range(N))==0: print(2**i) exit()