Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

powmod = [None] * 100
powmod[0] = 1
for i in range(60):
    powmod[i+1] = powmod[i] * 2 % MOD

def main():
    b = a >> np.arange(60).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    y = n - x
    x *= y
    x *= powmod[:60]
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed submission:
import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

powmod = [None] * 100
powmod[0] = 1
for i in range(60):
    powmod[i+1] = powmod[i] * 2 % MOD
    
def main():
    b = a >> np.arange(60).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    x = x * (n - x)
    x *= powmod[:60]
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed submission:
import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

def main():
    b = a >> np.arange(61).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    x = x * (n - x) % MOD
    # x *= 2 ** np.arange(60) % MOD
    for i in range(1, 61):
        x[i] *= pow(2, i, MOD)
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed submission:
import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

def main():
    b = a >> np.arange(60).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    x = x * (n - x) % MOD
    # x *= 2 ** np.arange(60) % MOD
    for i in range(60):
        x[i] *= pow(2, i, MOD)
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed submission:
import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

def main():
    b = a >> np.arange(60).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    x = x * (n - x) % MOD
    # x *= 2 ** np.arange(60) % MOD
    for i in range(60):
        x[i] *= pow(2, i, MOD)
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed submission:
import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)