Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese . 

Given an array of n non-negative integers: A_{1}, A_{2}, …, A_{N}. Your mission is finding a pair of integers A_{u}, A_{v} (1 ≤  u < v ≤ N) such that (A_{u} and A_{v}) is as large as possible.
And is a bit-wise operation which is corresponding to & in C++ and Java.

------ Input ------ 

The first line of the input contains a single integer N. The ith line in the next N lines contains the A_{i}.

------ Output ------ 

Contains a single integer which is the largest value of A_{u} and A_{v} where 1 ≤  u < v ≤ N.

------ Constraints ------ 

50 points:
$2 ≤ N ≤ 5000$
$0 ≤ A_{i} ≤ 10^{9}$
50 points:
$2 ≤ N ≤ 3 × 10^{5}$
$0 ≤ A_{i} ≤ 10^{9}$

----- Sample Input 1 ------ 
4
2
4
8
10
----- Sample Output 1 ------ 
8
----- explanation 1 ------ 
2 and 4 = 0
2 and 8 = 0
2 and 10 = 2
4 and 8 = 0
4 and 10 = 0
8 and 10 = 8