n = int(input()) num = 0 for a in map(int,input().split()): num |= a for i in range(100): if num >> i & 1: continue print(1<