Vasya has been very interested in exploring other planets since childhood. Growing up, he was able to fulfill his dream and participate in the launch of a meteorological station to Mars. Unfortunately, an error was made during the assembly of the station. To even greater regret, it was discovered after the station started working on the surface of the planet.
The problem lies in the data from an ultra-sensitive temperature sensor capable of receiving readings with an accuracy of up to millionths of a degree. Vasya was instructed to try to solve the problem.
The sensor takes data every second and sends readings to Earth as a series of 32-bit integers. The series consists of $$$n$$$ sequential temperature measurements $$$t_1, t_2, ..., t_n$$$.
After watching the video of the satellite assembly, Vasya found out that some sensor connectors were connected backward ; as a result, some bits are transmitted in an inverted form ($$$0$$$ instead of $$$1$$$ and $$$1$$$ instead of $$$0$$$). Also, in all measurements, these bits have the same numbers (the numbering of bits traditionally starts with the least significant one, which has the number $$$0$$$). It is not clear from the video which bits are being transmitted incorrectly, but Vasya decided to try to determine them from the data received.
Vasya has a series of measurements consisting of $$$n$$$ obtained distorted numbers $$$t_1, t_2, ..., t_n$$$. From the readings of other devices, it is known that the temperature first rose and then fell during the measurement process. Vasya wants to try to select some value $$$k$$$ and apply $$$t_i$$$ to the elements using the xor operation (bitwise exclusive «OR»): $$$r_i = t_i \, xor \, k$$$. The resulting sequence $$$r_1, r_2, ..., r_n$$$ should behave like the Martian temperature. First, it does not decrease and then does not increase, and the intervals of non-decreasing and non-increasing must be of length at least 2 (the intervals themselves can intersect).
Write a program that helps Vasya find the number $$$k$$$.
The first line of the input data contains the number of measurements $$$n$$$ ($$$3 \leq n \leq 10\,000$$$).
The second line contains distorted measurements in the form of integers $$$t_i$$$ ($$$0 \leq t_i \leq 2\,147\,483\,647$$$), separated by spaces.
In a single line, print the integer $$$k$$$ ($$$0 \leq k \leq 2\,147\,483\,647$$$). It is guaranteed that the data is correct and at least one such number exists.
If there are multiple solutions print any of them.
32 1 2
2
31 2 1
0
The xor operation exists in all modern programming languages; for example, in the languages $$$C\!+\!+$$$, $$$Python$$$ and $$$Java$$$ it is designated as «$$$ ^\wedge $$$», in $$$Pascal$$$ – as «xor». An example of using the «xor» operation: $$$10101_2 \oplus 10001_2 = 00100_2$$$.
| Name |
|---|


