Problem:
 Score : 500 points    Problem Statement There are N Snuke Cats numbered 1, 2, \ldots, N , where N is even .  Each Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.  Recently, they learned the operation called xor (exclusive OR).   What is xor?  For n non-negative integers x_1, x_2, \ldots, x_n , their xor, x_1~\textrm{xor}~x_2~\textrm{xor}~\ldots~\textrm{xor}~x_n is defined as follows:  When x_1~\textrm{xor}~x_2~\textrm{xor}~\ldots~\textrm{xor}~x_n is written in base two, the digit in the 2^k 's place ( k \geq 0 ) is 1 if the number of integers among x_1, x_2, \ldots, x_n whose binary representations have 1 in the 2^k 's place is odd, and 0 if that count is even.  For example, 3~\textrm{xor}~5 = 6 .   They wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.  We know that the xor calculated by Snuke Cat i , that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i .
Using this information, restore the integer written on the scarf of each Snuke Cat.      Constraints  All values in input are integers.  2 \leq N \leq 200000  N is even .  0 \leq a_i \leq 10^9  There exists a combination of integers on the scarfs that is consistent with the given information.         Input Input is given from Standard Input in the following format:  N  a_1  a_2  \ldots  a_N       Output Print a line containing N integers separated with space.  The i -th of the integers from the left should represent the integer written on the scarf of Snuke Cat i .  If there are multiple possible solutions, you may print any of them.        Sample Input 1 4
20 11 9 24      Sample Output 1 26 5 7 22   5~\textrm{xor}~7~\textrm{xor}~22 = 20  26~\textrm{xor}~7~\textrm{xor}~22 = 11  26~\textrm{xor}~5~\textrm{xor}~22 = 9  26~\textrm{xor}~5~\textrm{xor}~7 = 24   Thus, this output is consistent with the given information.

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
s = 0
for x in a: s ^= x

ans = [0] * n
for i in range(n):
    res = 0
    x, y = a[i], s
    for j in range(50):
        if x % 2 != y % 2: res += 2**j
        x >>= 1
        y >>= 1
    ans[i] = res

print(*ans)

Solution (Python):
import sys
from itertools import accumulate
from operator import xor

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()
A = [0] + LIST() + [0]

acc1 = list(accumulate(A, xor))
acc2 = list(accumulate(A[::-1], xor))[::-1]
ans = [0] * (N+1)
for i in range(1, N+1):
    ans[i] = acc1[i-1] ^ acc2[i+1]
print(*ans[1:])

Solution (Python):


N = int(input())
A = list(map(int, input().split()))
S = 0
for x in A:
    S ^= x
for i in range(len(A)):
    A[i] ^= S
print(*A)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

xor = 0
for a in A:
    xor ^= a

ans = []
for a in A:
    ans.append(a ^ xor)
print(*ans)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
base = 0
for a in A:
    base = base ^ a
ans = [base^a for a in A]
print(*ans)

Solution (Python):
n,A,num=int(input()),list(map(int,input().split())),0
for i in A:num ^=i
for i in A:print(num^i,end=" ")

Solution (Python):
n=int(input())
A=list(map(int,input().split()))

num=0
for i in A:num ^=i
for i in A:print(num^i,end=" ")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
temp = 0
for a in A:
    temp = temp ^ a
for a in A:
    print(temp ^ a, end=' ')

Solution (Python):
n=int(input())
arr=list(map(int,input().split()))
xors=0
for val in arr:
  xors^=val
ans=[]
for i in range(n):
  ans.append(xors^arr[i])
print(*ans)

Solution (Python):
n = int(input())
ls = list(map(int,input().split()))
x =0
for i in ls:
    x ^= i
for j in ls:
    print(x^j,end=" ")

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
s = 0

for x in a:
    s ^= x

ans = ''
for x in a:
    ans += str(s ^ x) + ' '
print(ans)

Solution (Python):
ans=0
n=int(input())
lis=input()
lis=lis.split(" ")
for i in range(0,n):
    lis[i]=int(lis[i])
    ans=ans^lis[i]
ans_lis=[]
for i in range(0,n):
    ans_lis.append(lis[i]^ans)
for i in range(0,n):
    print(ans_lis[i],end=" ")

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
s = 0
for x in a:
    s ^= x
ans = ''
for x in a:
    ans += str(s^x) + ' '
print(ans)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
x=A[0]^A[1]
for i in range(2,N):
  x=x^A[i]
ans=[x^a for a in A]
print(*ans)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()
	A = inputList()

	total = A[0]
	for i,val in enumerate(A):
		if i == 0:
			continue
		total = total ^ val

	ans = []
	for i,val in enumerate(A):
		tmp =  total ^ val
		ans.append(tmp)

	print(*ans)





if __name__ == "__main__":
	main()

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
b = a
S = 0
for i in range(N):
	S = S^a[i]

for i in range(N):
	b[i] = S^a[i]

print(*b)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
  sum ^= i
for i in a:
  print(sum ^ i,end=' ')

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

all = a[0]
for i in range(1, n):
  all = all ^ a[i]
  
for i in range(n):
  print(all ^ a[i])

Solution (Python):
def solve(A,N):
    xor_sum = 0
    for i in range(N):
        xor_sum ^= A[i]

    B = [xor_sum ^ A[i] for i in range(N)]

    return B

def main():
    N = int(input())
    A = list(map(int,input().split()))

    ans = solve(A,N)

    print(" ".join(map(str,ans)))

if __name__ == "__main__":
    main()

Solution (Python):

n=int(input())
a=list(map(int,input().split()))
s=0
for i in a:
 s^=i
for i in a:
 print(s^i,end=' ')
print()

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(N):
    s ^= a[i]

ans = []
for i in range(N):
    ans.append(a[i] ^ s)
print(*ans)

Solution (Python):
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    allxor = a[0]
    for i in range(1,n):
        allxor = allxor ^ a[i]
    b=[0]*n
    for i in range(n):
        b[i]=allxor ^ a[i]
    
    return b

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(' '.join(map(str,ans)))

Solution (Python):
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n = ri()
    A = rl()

    X = 0
    for a in A:
        X = X ^ a

    print (*[a^X for a in A])






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Solution (Python):
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))

    ans = [0] * N
    all_xor = 0
    for i in A:
        all_xor ^= i
    for i in range(N):
        ans[i] = all_xor ^ A[i]
    print(*ans)

main()

Solution (Python):




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

xor = a[0]
for i in a[1:]:
    xor ^= i

for i in a:
    print(xor ^ i, end=' ')
print()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
p=[a[0]]
for i in range(1,n):
  p.append(p[-1] ^ a[i])
  
S=p[-1]
b=[v^S for v in a]
print(*b,sep=' ')

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
s = 0
for i in range(n) :
    s = s ^ A[i]

ans = [0]*n
for i in range(n) :
    ans[i] = s ^ A[i]

print(*ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
a = A[0]
for a_ in A[1:]:
    a ^= a_
Ans = []

for x in A:
    Ans.append(str(x ^ a))
print(' '.join(Ans))

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n = int(readline())
lst1 = list(map(int,readline().split()))
res = 0
for i in lst1:
    res = res^i
ans = []
for i in lst1:
    ans.append(res^i)
print(*ans)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
"""
全員が自分以外の全員のxorを把握しているので、全員の値を求めよ
nは偶数

桁ごとに独立に考える。
テストケースで検証すると、
その桁において1の数が偶数個の場合は、自分自身の桁の数字を入れる
奇数個の場合は、自分自身の桁の値をbit反転したものを入れる
ことが正解であることが分かる。
これを実装するだけ。
"""
n = int(readline())
lst1 = list(map(int,readline().split()))
res = 0
for i in lst1:
    res = res^i
ans = []
for i in lst1:
    ans.append(res^i)
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
s = 0

for i in a:
    s = s^i

for i in a:
    print(i^s, end = " ")

Solution (Python):
import sys
readline = sys.stdin.readline


def main():
    N = int(readline())  
    A = list(map(int, readline().rstrip().split()))  
    
    xor = 0
    for a in A:
        xor ^= a
    
    res = [a ^ xor for a in A]
    print(*res)


if __name__ == '__main__':
    main()

Solution (Python):
from operator import xor
from functools import reduce
n = int(input())
A = list(map(int, input().split()))
total = reduce(xor, A)
print(*[total ^ a for a in A])

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

allxor = 0
for i in a:
    allxor ^= i


for i in a:
    print(allxor ^ i)

Solution (Python):
n,*a=map(int,open(0).read().split())
ans=0
for i in a:
  ans^=i 
for i in a:
  print(ans^i,end=" ")

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd
from operator import mul
from functools import reduce
from operator import mul
import pprint



sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
A = LI()
ret = 0
for i in A:
    ret ^= i

for j in A:
    print(ret ^ j)

Solution (Python):
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
total = 0
ans = []
for a in A:
    total^=a
for a in A:
    ans.append(str(total^a))
print(' '.join(ans))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

s = 0
for i in range(N):
    s ^= A[i]
for i in range(N):
    ans = s^A[i]
    print(ans, end=" ")

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
su = 0
for i in a:
  su ^= i
for i in a:
  print(su^i,end=' ')

Solution (Python):
N = int(input())
x = 0
*A, = map(int, input().split())
for i in range(N):
    x = x^A[i]
for i in range(N):
    print(x^A[i], end=" ")

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
X=0
for e in A:
  X=X^e
for e in A:
  print(X^e,end=" ")

Solution (Python):
num = int(input())
a_i = list(map(int, input().split()))
s = 0
for x in a_i:
    s ^= x
ans = []
for x in a_i:
    ans.append(x ^ s)
print(' '.join(map(str, ans)))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
X = 0
for ai in a:
    X ^= ai
for ai in a:
    print(ai ^ X, end=' ')
print('')

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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

tmp = 0
for num in a:
    tmp ^= num

ans = []
for num in a:
    ans.append(tmp^num)

print(*ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

tmp = a[0]
ans = [0]*N

for i in range(1,N):
    tmp ^= a[i]
    
for i in range(N):
    ans[i] = tmp^a[i]
    
print(*ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
X = a[0]
for i in range(1, N):
    X ^= a[i]
for ai in a:
    print(ai ^ X, end=' ')
print('')

Solution (Python):
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))

S = np.bitwise_xor.reduce(A)
print(*(A ^ S))

Solution (Python):
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()



n=ii()
a=lmi()
S=0
for i in a:
  S=S^i

b=[]
for i in a:
  a_=S^i
  b.append(a_)

print(' '.join(map(str,b)))

Solution (Python):
from functools import reduce


def xor(a, b):
    return a ^ b


def main():
    N = int(input())
    A = list(map(int, input().split()))
    total_xor = reduce(xor, A)
    vals = map(lambda v: total_xor ^ v, A)
    print(' '.join(map(str, vals)))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
t = 0
for e in a:
    t ^=e 
print(*[e ^ t for e in a])

Solution (Python):
n = int(input())
A = [*map(int, input().split())]
s = 0
for a in A: s ^= a
print(*[s ^ a for a in A])

Solution (Python):
N=int(input())
A=list(map(int, input().split()))
a=A[0]
for i in range(1,N):
  a=a^A[i]
D=[]
for i in range(N):
  D.append(a^A[i])
print(*D)

Solution (Python):
n = int(input())
A = [*map(int, input().split())]
all_xor = 0
for a in A: all_xor ^= a
print(*[all_xor ^ a for a in A])

Solution (Python):
n = int(input())
A = [*map(int, input().split())]


all_xor = 0
for a in A: all_xor ^= a

ans = []
for a in A: ans.append(all_xor ^ a)
print(*ans,sep=' ')

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]

s = 0
for v in A:
    s ^= v

print(' '.join([str(s ^ v) for v in A]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
ax = 0
ans = []
for a in A:
  ax ^= a
for a in A:
  ans.append(a^ax)
  
print(" ".join(map(str,ans)))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

b = 0
for i in a:
  b ^= i

ans = []
for i in a:
  ans.append(b^i)
print (*ans)

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	n = int(input())
	
	
	al = lin()
	aax=0
	for v in al:
		aax = aax^v
	ret = [v^aax for v in al]
	print(*ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))

x = 0
for a in A:
    x ^= a

ANS = [x ^ a for a in A]

print(*ANS)

Solution (Python):
import sys
import functools


def log(s):
    
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return list(map(int, input().split()))


def main():
    input()  
    aa = input_ints()

    x = functools.reduce(lambda a, b: a ^ b, aa)

    print(" ".join([str(x^a) for a in aa]))


main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
 
xor = 0
for i in A:
    xor ^= i
 
for j in range(N):
    print(xor^A[j], end=' ')

Solution (Python):
import sys
import collections
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))
xor = 0
for i in a:
    xor ^= i
res = [xor ^ i for i in a]
print(*res)

Solution (Python):


LI = lambda: list(map(int, input().split()))


N = int(input())
A = LI()


def main():
    s = 0
    for a in A:
        s ^= a
    ans = [s ^ a for a in A]
    print(*ans) 


if __name__ == "__main__":
    main()

Solution (Python):
 

from collections import defaultdict

import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

sys.setrecursionlimit(10**2)

	
def print_case_iterable(case_num, iterable):
	print("Case 

def print_case_number(case_num, iterable):
	print("Case 

def print_iterable(A):
	print (' '.join(A))

def read_int():
	return int(f.readline().strip())
def read_int_array():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def read_string():
	return list(f.readline().strip())
def ri():
	return int(f.readline().strip())
def ria():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def rs():
	return list(f.readline().strip())
def bi(x):
	return bin(x)[2:]





from collections import deque
import math

NUMBER = 998244353
def factorial(n) : 
	M = NUMBER
	f = 1
  
	for i in range(1, n + 1):  
		f = (f * i) % M 
						
	return f
def mult(a,b):
	return (a * b) % NUMBER

def minus(a , b):
	return (a - b) % NUMBER

def plus(a , b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		g, y, x = egcd(b % a, a)
		return (g, x - (b // a) * y, y)

def modinv(a):
	m = NUMBER
	g, x, y = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
def choose(n,k):
	if n < k:
		assert false
	return  mult(factorial(n), modinv(mult(factorial(k),factorial(n-k))))
from collections import deque, defaultdict 
import heapq


from types import GeneratorType
def bootstrap(f, stack=[]):
	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to

	return wrappedfunc


def dfs(g, timeIn, timeOut,depths,parents): 
	
	cnt = 0
	
	stack = [[1,0,0,0]]
	while stack:
		v,neig_i,parent,depth = stack[-1]
		parents[v] = parent
		depths[v] = depth
		
		if neig_i == 0:
			timeIn[v] = cnt    
			cnt+=1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i+=1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u,0,v,depth+1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
  
def isAncestor(u: int, v: int, timeIn: list, timeOut: list) -> str: 
	return timeIn[u] <= timeIn[v] and timeOut[v] <= timeOut[u] 

cnt = 0
@bootstrap
def dfs(v,adj,timeIn, timeOut,depths,parents,parent=0,depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt+=1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u,adj,timeIn,timeOut,depths,parents,v,depth+1)
	timeOut[v] = cnt
	cnt+=1
	yield 


def solution(a,n):
	dp = [0]
	for x in a:
		dp.append(dp[-1] ^ x)
	res= []
	for i in range(n):
		right_side_xor = dp[n]^dp[i+1]
		left_side_xor = dp[i]
		res.append(right_side_xor ^ left_side_xor)
	return ' '.join(map(str,res))

	
def main():
	T = 1
	
	for i in range(T):
		
		n = ri()
		a = ria()
		
		

		x = solution(a,n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			print >>output,str(x)
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()

if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()




if __name__ == '__main__':
	main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

L = 0
for a in A:
    L ^= a
for a in A:
    print(L ^ a)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans1 = A[0]
for i in range(1, N):
    ans1 = ans1 ^ A[i]

ans2 = []
for i in range(N):
    ans2.append(ans1 ^ A[i])

print(*ans2)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
  ans=ans^a[i]
anss=[]
for i in range(n):
  anss.append(ans^a[i])
print(*anss)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
a=0
for i in range(n):
    a=a^l[i]
ans=[]
for i in range(n):
    ans.append(a^l[i])
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

s = 0
for i in a:
    s ^= i

for i in a:
    print(s ^ i, end = " ")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))


s = a[0]
for num in a[1:]:
    s ^= num

    

res = [0] * n
for i, num in enumerate(a):
    res[i] = s ^ num

print(*res)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

A = 0
for e in a:
    A ^= e

for i in range(n):
    if i != 0:
        print(' ', end='')
    print(A^a[i], end='')
print()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = 0
for i in a:
	b ^= i
print(" ".join(map(lambda x: str(b ^ x), a)))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s ^= i
print(*[s ^ i for i in a])

Solution (Python):


import sys































def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    def solve(n, L):
        
        
        
        
        
        
        
        
        
        ans = [0] * n
        total = 0
        for i in range(n):
            total ^= L[i]
        for i in range(n):
            ans[i] = L[i] ^ total
        return ans

    
    
    
    
    
    
    
    
    
    


    
    
    
    
    
    
    
    
        
    

    n = ii()
    L = lmi()
    seq = solve(n, L)
    print(*seq, sep=' ')
    
    
    



if __name__ == "__main__":
    main()

Solution (Python):
N, = map(int, input().split())
X = list(map(int, input().split()))
t=0
for x in X:
    t=x^t
R=[]
for x in X:
    R.append(x^t)
print(*R)

Solution (Python):
N = int(input())

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



A_sum = 0
for ai in A:
    A_sum ^= ai

for i in range(N):
    ai = A[i]
    print(A_sum ^ ai, end=" ")
print()

Solution (Python):
n = int(input())
lis = list(map(int,input().split()))
X = lis[0]
for i in range(1,n):
    X ^= lis[i]
for i in lis:
    print(X^i,end=" ")

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
i=a[0]
for j in range(1,N):
  i=i^a[j]  
b=[0]*N
for o in range(len(b)):
  b[o]=str(i^a[o])
print(' '.join(b))

Solution (Python):

from functools import reduce
from operator import xor


def main():
    _, *A = map(int, open(0).read().split())
    total_xor = reduce(xor, A)
    res = [a ^ total_xor for a in A]
    print(" ".join(map(str, res)))


if __name__ == "__main__":
    main()

Solution (Python):

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
a = l()
A = 0
for i in range(N):
    A = A^a[i]
bit = bin(A)[2:]
n = len(bit)
bits = []
for i in range(N):
    bits.append(bin(a[i])[2:])
ans = []
maxlen = len(bin(max(a))[2:])
bit = list(bit.zfill(maxlen))[::-1]
for i in range(N):
    b = list(bits[i].zfill(maxlen))[::-1]
    num = 0
    for j in range(maxlen):
        if bit[j] != b[j]:
            num += 2**j
    ans.append(num)
print(*ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

p = 0
for i in range(N):
    p = p ^ a[i]



ans = [str(p ^ a[i]) for i in range(N)]

print(' '.join(ans))

Solution (Python):
n=int(input())
a_list=list(map(int,input().split()))
count=0
for i in a_list :
  count=count^i
list1=[]
for i in a_list :
  list1.append(count^i)

print(' '.join(map(str, list1)))

Solution (Python):
n=int(input())
ar=list(map(int,input().split()))
x=0
for i in ar:
    x^=i
for i in ar:
    print(x^i,end=' ')

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
x = 0
for i in a:
    x ^= i
a = map(lambda i:x^i, a)
for i in a:
    print(i, end = " ")
print()

Solution (Python):
def main():
    n = int(input())
    A = [int(e) for e in input().split()]

    s = 0
    for a in A:
        s ^= a

    print(*[s ^ a for a in A])


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(N):
    total = (A[i] ^ total)
for i in range(N):
    print(total ^ A[i])

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
s = A[0]
for i in range(1,n):
    s ^= A[i]
for i in A:
    print(s^i,end=" ")
print("\n")

Solution (Python):
N = int(input())

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

x = 0
for a in A:
  x ^= a

ans = []
for a in A:
  ans.append(x^a)
print(*ans)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
s = A[0]
for i in range(1,n):
    s ^= A[i]
for i in A:
    print(s^i,end=" ")
print("\n")

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N = in_n()
    a = list(in_nn())

    s = a[0]
    for i in range(1, N):
        s = s ^ a[i]

    ans = [0] * N
    for i in range(N):
        ans[i] = a[i] ^ s

    print(' '.join(map(str, ans)))


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

xor_all = A[0]
for i in range(1,N):
    xor_all ^= A[i]

ans = []
for i in range(N):
    ans.append(xor_all^A[i])
    
print(*ans)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
xor=0
for i in range(N):
  xor=xor^A[i]
for i in range(N):
  print(xor^A[i],end=" ")

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
num = 0
for a in A:
  num ^= a

l = []

for a in A:
  ans = a^num
  l.append(ans)
print(*l)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))



x_sum = 0
for i in range(len(a)):
    x_sum ^= a[i]

ans = []
for i in a:
    ans.append(x_sum ^ i)

for i in ans:
    print(i)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

S = 0
for i in range(N):
    S = S ^ a[i]

num = []
for i in range(N):
    num.append(S ^ a[i])

ans = " ".join(map(str, num))
print(ans)

Solution (Python):
N=int(input())
*A,=map(int,input().split())

All_Xor=0
for a in A:
    All_Xor^=a

ans=[0]*N
i=0
while i<N:
    ans[i]=All_Xor^A[i]
    i+=1

print(*ans)

Solution (Python):


N = int(input())
A = list(map(int, input().split()))

s = A[0]

for a in A[1:]:
    s ^= a

ret = []

for a in A:
    ret.append(s^a)

print(*ret)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

x_sum = a[0]
for i in range(1,len(a)):
    x_sum ^= a[i]

ans = []
for i in a:
    ans.append(x_sum ^ i)

for i in ans:
    print(i)

Solution (Python):
_,a=open(0)
*a,=map(int,a.split())
x=0
for i in a:x^=i
for i in a:print(x^i)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
allxor = 0
ans = [0]*n
for i in range(n):
    allxor = allxor^a[i]
for i in range(n):
    ans[i] = allxor^a[i]
ansstr = " ".join(map(str,ans))
print(ansstr)

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    a = list(map(int, input().split()))
    s = a[0]
    for i in range(1, N):
        s ^= a[i]
    ans = [str(x^s) for x in a]
    print(" ".join(ans))
if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    a = tuple(map(int, input().split()))
    ar = a[0]
    for i1 in range(1, n):
        ar ^=  a[i1]
    res = []
    for i1 in range(n):
        rt = ar ^ a[i1]
        res.append(rt)
    print(*res)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
sum_of_A = A[0]
for a in A[1:]:
    sum_of_A ^= a
ans = []
for a in A:
    ans.append((sum_of_A)^a)
print(" ".join(map(str, ans)))

Solution (Python):
n=int(input())
a=list(map(int, input().split()))

total = 0
for i in range(n):
  total = total ^ a[i]

for i in range(n):
  print(total^a[i])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

s = 0
for i in a:
    s = s^i

for i in a:
    print(s^i,end=" ")

Solution (Python):
n = input()
a_list = input().split()
a_int = [int(x) for x in a_list]

all_xor = 0
for a in a_int:
    all_xor ^= a

answer = ''
for a in a_int:
    answer += str(all_xor ^ a) + ' '

print(answer)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

S = 0
for a in A:
  S ^= a

ans = list(map(lambda x: x ^ S, A))

print(*ans)

Solution (Python):
"""
~~ Author : Bhaskar
~~ Dated : 10~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")
input = lambda : sys.stdin.readline()

def solve():
    n = int(sys.stdin.readline())
    a = list(map(int, sys.stdin.readline().split()))
    s = 0
    for i in a:
        s ^= i
    for i in a:
        print(s^i,end = " ")
    print()



if __name__ == "__main__":
    try:
        sys.stdin = open('input.txt','r')
        sys.stdout = open('output.txt','w')
    except:
       pass
    solve()

Solution (Python):
n = int(input())
arr = list(map(int, input().split()))

a = arr[0]
for i in range(1, len(arr)):
    a ^= arr[i]


for i in range(len(arr)):
    print(a^arr[i], end=" ")

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

s=0
for i in A:
    s = s^i
for i in A:
    print(s^i)