import java.util.Scanner

object Main extends App {

  def readALine(c:Int, ac:List[Int]=Nil):List[Int] =
    if (c > 0) readALine(c-1, sc.nextInt::ac) else ac.reverse
  // def readLines(r:Int, c:Int, ac:List[List[Int]]):List[List[Int]] =
  //   if (r > 0) readLines(r-1, c, readALine(c, Nil)::ac) else ac.reverse
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val Ai = readALine(N)

  def solver():List[Int] = {
    def prod(l:List[Int], ac:Int = 0):Int = {
      if (l.isEmpty) ac else prod(l.tail, l.head ^ ac)
    } 
    def iter(al:List[Int], bl:List[Int], ac:List[Int]):List[Int] = {
      if (al.isEmpty) ac.reverse else {
        val a0 = al.head
        val a1 = al.tail.head
        val al_ = al.tail.tail
        val others = prod(al_) ^ prod(bl)
        iter(al_,a1::a0::bl, (a0^others)::(a1^others)::ac)
      }
    }
    iter(Ai, Nil, Nil)
  }

  println(solver().mkString(" "))

}