#P10471. Maximum XOR Pair

    ID: 12483 Type: Default 1000ms 256MiB

Maximum XOR Pair

Maximum XOR Pair

Given N integers A1, A2, ..., AN, choose two distinct integers and compute their bitwise XOR. Determine the maximum XOR value that can be obtained.

You can assume that the input consists of at least two numbers.

inputFormat

The input is given in two lines. The first line contains an integer N representing the number of integers. The second line contains N space-separated integers.

outputFormat

Output a single integer which is the maximum XOR value obtained by XORing any two distinct numbers from the given list.

sample

4
0 1 2 3
3