#Lutece2085. 最大与和

最大与和

Description

给定 NN 个非负整数 A1,A2,,ANA_1,A_2,\ldots,A_N。你的任务是找到其中的两个数 Au,AvA_u,A_v1u<vN1\le u<v\le N),使得 Au and AvA_u\texttt{ and }A_v 尽可能大。这里 and\texttt{and} 是按位与,对应 C++ 和 Java 的 &

Input

输入数据的第一行包含一个整数 NN2N3×1052\le N\le 3\times 10^5)。接下来的 NN 行,每行输入一个非负整数 AiA_i0Ai1090\le A_i\le 10^9)。

Output

输出一行表示最大的 Au and AvA_u\texttt{ and }A_v1u<vN1\le u<v\le N)。

Samples

4
2
4
8
10
8