M is alone and he has an array a1,a2,...,an. M wants to choose two integers i,j such that i≠j,1≤i,j≤n and the value ai&aj(bitwise AND) is maximum.
What is the maximum value M can get?
Input
First line contains only n, legnth of array.
Second line contains the array elements a1,a2,...,anseparated by space.
1≤n≤3×105
1≤ai≤109
Output
The only line of output contains an integer, maximum value value that M can get.
M can choose a1=3 and a4=3 with bitwise AND 3 which is maximum.