408028: GYM102964 B Krosh and xor of sums
Description
Krosh has an array of $$$n$$$ non-negative integers. He determines the beauty of array in the following way. He picks a number $$$1 \le k \le n$$$ and some sequence $$$b$$$ of $$$k$$$ different integers $$$1 \le b_i \le n$$$. Then he determines the value of this sequence $$$V(b)$$$ as sum of elements of an array $$$a$$$ on the corresponding positions from array $$$b$$$: $$$V(b) = \sum \limits_{i = 1}^k a_{b_i}$$$. Then the beauty of an array $$$a$$$ equals to bitwise xor of all the values $$$V(b)$$$ over all possible sequences $$$b$$$ which can be obtained in the way described above(pick $$$k$$$ and $$$k$$$ different numbers from $$$1$$$ to $$$n$$$). Help Krosh to determine the beauty of an array $$$a$$$.
InputIn first line you are given number $$$1 \le n \le 2 * 10^5$$$ – number of elements in array $$$a$$$. In the next line you are given an array $$$a$$$ of $$$n$$$ non-negative integers $$$0 \le a_i \le 10^7$$$.
OutputOutput the beauty of an array $$$a$$$.
ExamplesInput2 1 2Output
3Input
1 10Output
10