The Duel of Spells
Time limit: 2.0 sec
Memory limit: 256 MB
Problem Statement
In the ancient realm of Eldoria, mighty wizards gather to duel using the potent energy of their spells. Each spell is imbued with a unique magic number, and it is believed that the more powerful the combination of two spells, the stronger the resulting force. The power of two spells is determined by computing the bitwise XOR of their magic numbers.
Now, as the kingdom teeters on the brink of chaos, you have been tasked with aiding a renowned wizard in selecting the two spells from his collection that yield the maximum possible magic power. Given a list of $n$ spells with their respective magic numbers, your task is to determine the highest value obtainable by performing the bitwise XOR on any two distinct spells.
Your journey through the arcane art of computation begins now!
## Input Format
- The first line contains an integer $n$ ($2 \leq n \leq 10^5$), representing the number of spells.
- The second line contains $n$ space-separated positive integers, where each integer denotes the magic number associated with a spell.
## Output Format
- Output a single integer — the maximum XOR value of any pair of spells from the list.
## Examples
#### Input
3
1 2 3
#### Output
3
#### Input
4
4 6 7 8
#### Output
15