n = int(input()) a = list(map(int,input().split())) b = 0 for i in a: b |= i c = 0 while b>0: if b&1==0: break c += 1 b >>= 1 print(pow(2,c))