A ground station tracks a fleet of n drones, each broadcasting a non-negative integer identification code. To gauge signal diversity, the station wants the largest possible XOR value obtainable by pairing any two different drones (by index; the two drones' codes may still be numerically equal).
Given the codes, find the maximum XOR of any such pair.
Input format
Line 1: an integer n.
Line 2: n space-separated non-negative integers, the drone codes.
Output format
A single integer: the maximum XOR value over all pairs of distinct indices i \ne j.
Constraints
- 2 ≤ n ≤ 2000
- 0 ≤ code ≤ 1,000,000