N = int(input()) A = list(map(int, input().split())) s = set() for a in A: for i in range(60): if (a >> i) & 1: s.add(i) for i in range(100): if i in s: continue break print(1 << i)