Cheongrin wants to send LAN alarm clocks as a birthday gift to an online friend, Ddudda, who rarely wakes up even when an alarm rings.
A LAN alarm clock is different from an ordinary alarm clock. When several LAN alarm clocks ring at the same time, their sounds merge into one sound. The loudness of the resulting sound is the bitwise OR of the loudness values of those alarm clocks.
Cheongrin found candidate LAN alarm clocks on the internet. They all have distinct loudness values. Sending all of them would maximize the resulting loudness, but an excessively loud alarm might hurt Ddudda's hearing.
Therefore, Cheongrin wants to choose at least one alarm clock so that the loudness obtained by ringing all chosen alarm clocks at the same time is at most , and among all such choices, the resulting loudness is as large as possible.
Find that maximum possible loudness.
Input
The input is given in the following format.
is the loudness of the -th LAN alarm clock.
Output
If Cheongrin can choose at least one LAN alarm clock satisfying the condition, print the maximum possible loudness obtained by ringing all chosen alarm clocks at the same time.
If there is no valid non-empty choice, print instead.
Constraints
- .
- .
- ().
- are pairwise distinct.
Subtasks
Samples
Choosing , , , and gives loudness , which is at most . Here, denotes bitwise OR.
Choosing only gives loudness , which is at most .
There is no valid non-empty choice.