409719: GYM103708 A Anya's gifts
Description
Anya has a big problem. Her father's birthday and National Father's Day happen in the same week. Anya loves her father so she bought a large number of gifts to give him. Anya doesn't want to give him all gifts in one day, that's why she will give some gifts to her father on his birthday and the rest of them on father's day. Of course, all gifts must be given and her father must receive at least one gift on each of the two dates.
Anya's father is a very elegant man with refined tastes, so his gifts should be as elegant as possible. At the time of purchasing the gifts, the store owner gave an elegance score to each of the gifts. Anya wants to distribute the gifts in such a way that the sum of the XOR of the elegance score of the gifts she gives on Father's Day and the XOR of the elegance score of the gifts she gives on his birthday is maximum.
Help Anya accomplish this difficult and elegant task.
InputThe first line contains an integer $$$N$$$ ( $$$2 \leq N \leq10^{5}$$$ )indicating the number of gifts Anya bought.
The next line contains $$$N$$$ integers $$$e_{i}$$$ ($$$0 \leq e_{i} < 2^{50}$$$) for $$$i = 1,2...N$$$, denoting the score of elegance of each present.
OutputOutput a single line with an integer representing the result of this task.
ExamplesInput4 1 2 4 8Output
15Input
4 10 8 6 17Output
41