N = int(input()) A = list(map(int, input().split())) from bisect import * l = [] now = 0 for i in reversed(range(30)): need = 1<