N = int(input()) A = list(map(int, input().split())) B = [0 for _ in range(100)] for a in A: b = bin(a)[2:] b = b[::-1] for i in range(len(b)): if b[i]=="1": B[i]+=1 pos = B.index(0) print(2**pos)