fun main(args: Array<String>) {
    readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }

    val sum = a.reduceRight{ i,j ->
        i.xor(j)
    }

    a.forEach {
        print("${it.xor(sum)} ")
    }
}

