You are given array A, B each containing N inetegers. You have to create array C of N inetegers where Ci=Ai&Bi (Here, & denotes the Bitwise AND operation). You can shuffle elements of A, B however you want. Find maximum value of C1&C2&…&CN.
Input format
The next line contains N space-separated integers B1,B2,…,BN - denoting the elements of B.
Output format
For each test case, print maximum value of C1&C2&…&CN in a separate line.
Constraints
1≤T≤1051≤N≤1050≤Ai,Bi≤109
The sum of N over all test cases does not exceed 105.
The best configuration here will be have A1=3, and B1=3, and A2=2 and B2=2. So the array C will be [3,2]. So the answer will be 2 (3&2=2).