import java.math.BigInteger fun main() { readLine() val a = readLine()!!.split(" ").map { it.toBigInteger() } for (i in 0..60) { val x = BigInteger.TWO.pow(i) if (a.all { (it + x) == it.xor(x) }) { println(x) return } } }