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 i in range(N):
    s ^= a[i]
ans = []
for i in range(N):
    ans.append(a[i]^s)
print(*ans)

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = 0
for num in a:
    val = val ^ num
ans = [None]*n
for i,num in enumerate(a):
    ans[i] = val^num
write(" ".join(map(str, ans)))

Solution (Python):

from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

N = int(input())

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



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

answer = []
for a in A:
    answer.append(xorA ^ a)
    
print(*answer)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque


from collections import Counter

from itertools import accumulate,combinations,permutations

from heapq import heapify,heappop,heappush


from functools import lru_cache

from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    

    N = int(input())
    
    A = tuple(map(int, input().split())) 
    
    
    tot=0
    for a in A:
        tot^=a
    ans=[a^tot for a in A]
    print(*ans)





if __name__ == "__main__":
    main()

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

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

print(*[x^allxor for x in A])

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 = 0
for a in A:
    s = s^a

ans = [0]*n
for i in range(n):
    ans[i] = s^A[i]
print(' '.join(str(i) for i in ans))

Solution (Python):


import functools


def restore_array(bs):
    all_xor = functools.reduce(lambda x, y: x ^ y, bs)
    res = [all_xor ^ b for b in bs]
    return res


def main():
    n = int(input())
    bs = [int(b) for b in input().split()]
    print(*restore_array(bs))


if __name__ == '__main__':
    main()

Solution (Python):
def main():

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

    all = 0
    for v in a: all ^= v

    ans = []
    for v in a:
        ans.append(v^all)
    return " ".join(map(str, ans))


if __name__ == '__main__':
    print(main())

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
S = 0
for x in A:
    S ^= x
print(*[S^x for x in A])

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

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

ans = [s ^ ai for ai in a]
print(*ans)

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

Solution (Python):

n = int(input())
l = list(map(int, input().split()))
ans = l[0]
for i in range(1, n):
    ans ^= l[i]
for i in l:
    print(ans ^ i, end=' ')

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n):
    res = [None] * n
    for i in range(n):
        res[i] = II()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI()
    return res
def FR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR_(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI_()
    return res
def SR(n):
    res = [None] * n
    for i in range(n):
        res[i] = S()
    return res
def LSR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LS()
    return res
mod = 1000000007
inf = float('INF')


def solve():
    n = II()
    a = LI()
    ans = 0
    for i in range(n):
        ans ^= a[i]
    tmp = []
    for j in range(n):
        tmp.append(ans ^ a[j])
    print(*tmp)
    return



if __name__ == '__main__':
    solve()

Solution (Python):
def examA():
    S = SI()
    if S in alphabet:
        ans = "a"
    else:
        ans = "A"
    print(ans)
    return

def examB():
    N, K = LI()
    P = LI()
    P.sort()
    ans = sum(P[:K])
    print(ans)
    return

def examC():
    N = I()
    ans = ""
    while(N>0):
        N -= 1
        ans += alphabet[N%26]
        N //= 26
        if N==0:
            break
    print(ans[::-1])
    return

def examD():
    N = I()
    A = LI()
    D = defaultdict(int)
    for a in A:
        D[a] += 1
    S = sum(A)
    q = I()
    ans = [0]*q
    for i in range(q):
        a, b = LI()
        if not a in D:
            ans[i] = S
            continue
        S += (b-a)*D[a]
        D[b] += D[a]
        D[a] = 0
        ans[i] = S

    for v in ans:
        print(v)
    return

def examE():
    N = I()
    A = LI()
    S = 0
    for a in A:
        S ^= a
    
    ans = [0]*N
    for i in range(N):
        ans[i] = S^A[i]
    print(" ".join(map(str,ans)))
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examE()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

s = 0
for x in a:
  s ^= x
ans = [x^s for x in a]
print(" ".join(map(str, ans)))

Solution (Python):
import sys
import numpy as np

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

N = int(readline())
A = np.array(read().split(), np.int64)

def main(A):
    N = len(A)
    if N % 2 == 0:
        S = np.bitwise_xor.reduce(A)
        return A ^ S
    return A

B = main(A)
print(' '.join(map(str, B.tolist())))

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

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):
def main():
    N = int(input())
    *A, = map(int, input().split())

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

    ans = (x ^ all_xor for x in A)

    print(*ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n = ni()
    a = nl()
    e = 0
    for x in a:
        e ^= x
    b = [e^x for x in a]
    print(*b)
    return

solve()

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
def xor(x,y):
    return x^y
s = 0
for val in a:
    s = xor(s,val)
res = []
for val in a:
    res.append(s^val)
print(*res)

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

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

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

ans = [e ^ x for e in a]
print(*ans)

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

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

ans = [0] * n
for i in range(n):
    ans[i] = a[i] ^ tot_xor
print(*ans)

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

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

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

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

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

N = int(input())
a = list(map(int, input().split()))
xor = 0
for x in a:
    xor ^= x
b = [xor ^ x for x in a]
print(*b)

Solution (Python):
N = int ( input().strip() ) ;
arr = list ( map ( int , input().strip().split(" ") ) ) ;

c0 = 0 ;
for v in arr :
	c0 = c0 ^ v ;

arr2 = list ( map ( lambda x:c0^x , arr ) ) ;
print ( " ".join(  map( str , arr2 ) ) ) ;

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

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

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

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

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

ans = []
for a in A:
    ans.append(a ^ m)

print(*ans)

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

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

for i in a:
  print(t ^ i)

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

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    s = 0
    for i in a:
        s ^= i
    ans = [s^i for i in a]
    print(*ans)
    return


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
b = 0
for i in a:
    b ^=i
ans = [i ^ b for i in a]
print(*ans)

Solution (Python):
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
a = na()

x = 0
for v in a:
    x ^= v
b = []
for i in range(n):
    b.append(a[i]^x)
print(" ".join(map(str, b)))

Solution (Python):
n,*a=map(int,open(0).read().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()))
x = 0
for a in A:
    x ^= a
print(" ".join(map(str, [x^a for a in A])))

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]



from collections import defaultdict as ddic

def solve(N, A):
    X = 0
    for x in A: X^=x
    return [X^x for x in A]


ans = solve(rri(), rrm())
print " ".join(map(str, ans))

Solution (Python):
def main():
    n=int(input())
    A=list(map(int,input().split()))
    acc=0
    for a in A:
        acc^=a
    Ans=[0]*n
    for i,a in enumerate(A):
        Ans[i]=acc^a
    print(*Ans)
    
if __name__=='__main__':
    main()

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

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