Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=sum(bit)
    ans+=s*(n-s)*po
    ans%=N
    po*=2
    po%=N
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = 10**9+7
n = int(input())
a = list(map(int,input().split()))

ans = 0

po = 1
for i in range(61):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*po
    ans%=N
    po*=2
    po%=N
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = 10**9+7
n = int(input())
a = list(map(int,input().split()))

ans = 0

for i in range(61):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*pow(2,i,N)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N = 10**9+7
n = int(input())
a = list(map(int,input().split()))

ans = 0

a1 = max(a)
if a1 == 0:
    a1=2
ma = int(math.log2(a1))
if ma<0:
    ma=0
for i in range(ma+2):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*pow(2,i,N)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = 10**9+7
n = int(input())
a = list(map(int,input().split()))

ans = 0

a1 = max(a)
if a1 == 0:
    a1=2
ma = int(math.log2(a1))
if ma<0:
    ma=0
for i in range(ma+2):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*pow(2,i,N)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N = 10**9+7
n = int(input())
a = list(map(int,input().split()))

ans = 0

ma = int(math.log2(max(a)))
if ma<0:
    ma=0
for i in range(ma+2):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*pow(2,i,N)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))

ans = 0
for i in range(int(math.log2(max(a)))+2):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*(2**i)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))

ans = 0
for i in range(int(math.log2(max(a)))+2):
    sum=0
    for j in range(n):
        sum+=(a[j]>>i) & 1
    ans+=sum*(n-sum)*(2**i)
    ans%=10**9+7
print(ans)


Fixed submission:
import numpy as np
N = 10**9+7
n = int(input())
a = np.array(input().split(), np.int64)

ans = 0

po = 1
for i in range(61):
    bit = (a>>i) & 1
    s=np.count_nonzero(bit)
    ans+=s*(n-s)%N*po
    ans%=N
    po*=2
    po%=N
print(ans)