Xor
시간 제한1초메모리 제한2048 MB
i <= j인 모든 쌍의 합 a_i + a_j를 전부 xor한 값을 구한다.
문제
Fran recently learned the operation xor, which for two integers and returns the result by applying the bitwise exclusive or (exclusive or). The operation xor, denoted as , compares the corresponding bits of the numbers and and sets the result bit at each position according to the following rule:
- If the bits at the corresponding position are different ( and , or and ), then the result bit is .
- If the bits are the same ( and , or and ), then the result bit is .
For example, for and , the binary representations are: , . Applying xor to the corresponding bits gives . In other words, .
Fran received an array of integers and decided to do the following:
- For every pair of indices where , he calculated the sum .
- Now he wants to calculate the result of the xor of all the obtained sums.
Help Fran calculate the required result.
입력
In the first line of input, there is (), the length of the array.
In the second line, there are numbers () as described in the problem statement.
출력
In the only line of output, print the required result.
힌트
Clarification of the first example:
The sums are , , , , , and . The result is .