n=int(input()) a=sorted(list(map(int,input().split())),reverse=True) rank=0 for j in range(60,-1,-1): idx=-1 for i in range(rank,n): if a[i]&(1<