LearnPy Hub
← Arena
AdvancedRating 1600

Total XOR of All Pairs

Print the sum of aᵢ XOR aⱼ over all pairs i < j.

Input

n, then n non-negative integers below 2³⁰.

Output

One integer.

Sample 1

Input
3
7 3 5
Output
12

Sample 2

Input
1
9
Output
0
solution.py
Output appears here
Total XOR of All Pairs · Python Arena problem · LearnPy Hub