Buggy python submission (verdict: Runtime Error):
L = [0 for i 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)

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i + 1)]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)


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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Runtime Error):
L = [0 for i 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)

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i + 1)]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)


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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [0 for i 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] += int(tmp[j])

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i + 1)]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [0 for i 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] += int(tmp[j])

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i + 1)]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [[0 for i in range(N)] for j in range(60)]
As = map(int, input().split())
mod = 1000000007
ans = 0
index = 0

for A in As:
    tmp = format(A, 'b').zfill(60)
    for j in range(60):
        L[j][index] = int(tmp[j])
    index += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i + 1)]
    a = sum(L[i]) % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)


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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
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]))

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i+1)]
    a = sum(L[i]) % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)


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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [[] for i 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].append(int(tmp[j]))

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[-(i+1)]
    a = sum(L[i]) % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [[] for i 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].append(int(tmp[j]))


def calc(acc, i):
    if i == 0:
        return acc
    else:
        return calc(acc*2 % mod, i-1)


for i in range(60):
    tmp = calc(1, 59 - i)
    a = sum(L[i]) % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod
ans = ans % mod
print(ans)

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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [[] for i 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].append(int(tmp[j]))


def calc(acc, i):
    if i == 0:
        return acc
    else:
        return calc(acc*2 % mod, i-1)


for i in range(60):
    tmp = calc(1, 59 - i)
    a = sum(L[i]) % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod
ans = ans % mod
print(ans)

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

for A in As:
    for i in range(60):
        if A >> i & 1 == 1:
            L[i] += 1

acc = 1
tmps = []
for i in range(60):
    tmps.append(acc)
    acc = acc * 2 % mod

for i in range(60):
    tmp = tmps[i]
    a = L[i] % mod
    b = (N - a) % mod
    ans += (tmp * a * b) % mod

ans = ans % mod
print(ans)