Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split()))

xor_sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    xor_sum += (A[i]^A[j])

dst = xor_sum % (10**9+7)
print(dst)

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int, input().split()))

ans = 0

for i in range(N-1):
  for j in range(i+1, N):
    ans += (A[i]^A[j])
    
print(ans%(10**9+7))

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N = input()
A = list(map(int, input().split()))

xor_sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    xor_sum += (A[i]^A[j])

dst = xor_sum % (10**9+7)
print(dst)

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


N = input()
N -= 1
A = list(map(int, input().split()))

xor_sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    xor_sum += (A[i]^A[j])

dst = xor_sum % (10**9+7)
print(dst)
    
    


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


N = input()
A = list(map(int, input().split()))

sum = 0
for i in range((N-1)-1):
  for j in range(i+1, (N-1)):
    sum += (A[i]^A[j])

dst = sum % (10**9+7)
print(dst)
    
    


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


N = input()
A = list(map(int, input().split()))

sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    sum += (A[i]^A[j])

dst = sum % (10**9+7)
print(dst)
    
    


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


N = input()
A = input().split()

sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    sum += (A[i]^A[j])

dst = sum % (10**9+7)
print(dst)
    
    


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


N = input()
A = [input().split() for i in range(N)]

sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    sum += (A[i]^A[j])

dst = sum % (10**9+7)
print(dst)
    
    

Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)