import java.util.*
import kotlin.collections.HashMap
import kotlin.math.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map(String::toInt) // list of ints
private fun readLongs() = readStrings().map(String::toLong) // list of longs

fun main() {
    val n = readInt()
    val a = readInts()
    var f: Int = a.drop(1).reduce { acc, i -> acc xor i }
    var last = a[0]
    print("$f ")
    println(a.drop(1).map {
        f = f xor last xor it
        last = it
        f.toString()
    }.joinToString(" "))

}
