n,*A = map(int,open(0).read().split()) ans = [] for k in range(30)[::-1]: r = 0 while r>k&1: A[r] += 1<