n = int(input())

a = list(map(int,input().split()))

b = [0]*(n-1)

ans = a[0]

for i in range(1,n):

  b[i-1] = a[0]^a[i]

  ans ^= b[i-1]

print(ans,end=' ')

for i in range(1,n):

  print(ans^b[i-1],end=' ')

import sys

def Ii():return int(sys.stdin.readline())

def Mi():return map(int,sys.stdin.readline().split())

def Li():return list(map(int,sys.stdin.readline().split()))



n = Ii()

a = Li()

b = 0

for i in range(n):

  b ^= a[i]

ans = []

for i in range(n):

  print(b^a[i],end=' ') 

n = int(input())
a = list(map(int, input().split()))
b = [0] * (n - 1)
ans = a[0]
for i in range(1, n):
    b[i - 1] = a[0] ^ a[i]
    ans ^= b[i - 1]
print(ans, end=" ")
for i in range(1, n):
    print(ans ^ b[i - 1], end=" ")

import sys


def Ii():
    return int(sys.stdin.readline())


def Mi():
    return map(int, sys.stdin.readline().split())


def Li():
    return list(map(int, sys.stdin.readline().split()))


n = Ii()
a = Li()
b = 0
for i in range(n):
    b ^= a[i]
ans = []
for i in range(n):
    print(b ^ a[i], end=" ")

-n = int(input()) -a = list(map(int, input().split())) -b = [0] * (n - 1) -ans = a[0] -for i in range(1, n): -    b[i - 1] = a[0] ^ a[i] -    ans ^= b[i - 1] -print(ans, end=" ") -for i in range(1, n): -    print(ans ^ b[i - 1], end=" ") +import sys + + +def Ii(): +    return int(sys.stdin.readline()) + + +def Mi(): +    return map(int, sys.stdin.readline().split()) + + +def Li(): +    return list(map(int, sys.stdin.readline().split())) + + +n = Ii() +a = Li() +b = 0 +for i in range(n): +    b ^= a[i] +ans = [] +for i in range(n): +    print(b ^ a[i], end=" ")