N = int(input())
L = [[0 for i in range(N)] for j in range(60)]
As = list(map(int, input().split()))
mod = 1000000007
ans = 0

for i in range(N):
    tmp = format(As[i], 'b').zfill(60)
    for j in range(60):
        L[j][i] = int(tmp[j])
