n=int(input()) a=[*map(int,input().split())] for i in range(30)[::-1]: l=1;r=0 if a[0]>>i&1:continue while r