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 = [int(n) for n in input().split()]
X = 0
ans = []
for i in range(N):
  X = X^A[i]
for i in range(N):
  ans.append(X^A[i])
print(*ans)

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

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

for j in range(N):
    b.append(S^a[j])

print(*b)

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

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

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

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(str(xor ^ a_))

print(' '.join(ans))

Solution (Python):
def main():
    N = int(input())
    a = [int(i) for i in input().split()]
    x = 0
    for i in range(N):
        x ^= a[i]

    x ^= a[0]
    xors = [x]
    for i in range(1, N):
        x ^= a[i-1]
        x ^= a[i]
        xors.append(x)

    print(' '.join(str(x) for x in xors))


main()

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

Solution (Python):
n=int(input(""))
a=[]
ans=[1]
ain=input("").split(" ")
for i in range(n):
    a+=[int(ain[i])]
s=a[1]
for i in range(n-2):
    s^=a[i+2]
ans[0]=s
for i in range(n-1):
    s=s^a[i]
    s^=a[i+1]
    ans+=[s]
b=[]
for i in range(n):
    b+=[str(ans[i])]
print(" ".join(b))

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

Solution (Python):
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
ans = 0
for a in a_ls:
    ans ^= a
print(" ".join([str(ans ^ a) for a in a_ls]))

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

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

for ai in a:
    X ^= ai

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

Solution (Python):








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

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

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

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

xor_all = 0

for a in A:
    xor_all ^= a



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

print(' '.join(ans))

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

s = li[0]

for i in range(1,n):
    s ^= li[i]

ans = []

for i in li:
    tmp = s^i
    ans.append(tmp)
    
print(*ans)

Solution (Python):
import numpy as np
N = int(input())
a = np.array(list(map(int,input().split())))

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

for i in a:
    print(xor^i)

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

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

for i in a:
    print(xor^i)

Solution (Python):
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

INF = 10**18
eps = 10**-7

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

s = 0
for ai in a:
    s = s^ai
ans = []
for ai in a:
    ans.append(s^ai)
print(' '.join(map(str,ans)))

Solution (Python):

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left, bisect_right 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
A = list(map(int, input().split()))
s = 0
for a in A:
    s ^= a
B = [s^a for a in A]
print(*B)

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(*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 i in a:
  s^=i
 
t=[]
for i in a:
  t_=i^s
  t.append(t_)
  
print(' '.join(map(str,t)))

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

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

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

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

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

ans = []
for elem in a:
    ans.append(elem ^ xor)

print(*ans)

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

XOR = 0

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

B = []

for i in range (0, N):
	B.append(XOR^A[i])

print(*B)

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
a = LI()

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

for i in range(N):
    anss.append(ans_base ^ a[i])


anss = map(str, anss)
print(" ".join(anss))

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

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


x = 0
for i in a:
    x ^= i
b = [x^y for y in a]
print(' '.join(map(str, b)))

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):
n = int(input())
aa = input().split(" ")
a = [int(c) for c in aa]

s = a[0]

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

ans = [0]*n

for i, num in enumerate(a):
	ans[i] = s^num

print(*ans)

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    N = int(input())
    A = list(map(int, input().split()))
    S = 0
    for a in A:
        S = S ^ a
    answer = []
    for a in A:
        answer.append(S ^ a)
    print(*answer)


if __name__ == "__main__":
    main()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = 0
    for a in A:
        B ^= a

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

    print(*ans, sep=" ")


if __name__ == "__main__":
    main()

Solution (Python):



def main() -> None:
    N = ri()
    a = rmi()
    assert len(a) == N
    result = []
    all_xor = 0
    for item in a:
        all_xor ^= item
    for item in a:
        result.append(item ^ all_xor)
    w(' '.join(map(str, result)))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()

Solution (Python):



def main() -> None:
    N = ri()
    a = rmi()
    assert len(a) == N
    result = []
    all_xor = 0
    for item in a:
        all_xor ^= item
    for item in a:
        result.append(item ^ all_xor)
    w(' '.join(map(str, result)))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()

Solution (Python):
def resolve():
    import sys
    sys.setrecursionlimit(10 ** 6)  
    to_index = lambda x: int(x) - 1  
    print_list_in_2D = lambda x: print(*x, sep="\n")  
    print_list_with_space = lambda x: print(*x, sep=" ")

    
    def input_int(): return int(input())

    def map_int_input(): return map(int, input())

    MII = map_int_input

    def MII_split(): return map(int, input().split())

    def MII_to_index(): return map(to_index, input())

    def MII_split_to_index(): return map(to_index, input().split())

    
    def list_int_inputs(): return list(map(int, input()))

    LII = list_int_inputs

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

    
    def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

    def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

    N = input_int()
    a_list = LII_split()
    b_list = []

    xor_all = a_list[0]
    for a in a_list[1:]:
        xor_all ^= a

    for a in a_list:
        b_list.append(a^xor_all)
    
    print_list_with_space(b_list)
    
resolve()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    n = ini()
    a = inl()
    x = 0
    for y in a:
        x ^= y
    b = [x ^ y for i, y in enumerate(a)]
    return b


print(*solve())

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

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

arr = [i^total for i in arr]
print(*arr)

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

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

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

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

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

ans=[]

for i in range(n):
    q=(p^lst[i]) 
    ans.append(str(q))
    
print(" ".join(ans))

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

Solution (Python):
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=' ')

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):
    print(s ^ a[i])

Solution (Python):
N = int(input())
aaa = list(map(int, input().split()))
a_all = 0
for a in aaa:
    a_all ^= a
print(*list(a_all ^ a for a in aaa))

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

numbers = []

s = A[0]
for i in range(1, N):
    s = s ^ A[i]
for i in range(N):
    numbers.append(s ^ A[i])

print(*numbers)

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

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

Solution (Python):
def xsum(A):
    total=0
    for i in range(len(A)):
        total^=A[i]
    return total

n=int(input())
A=list(map(int,input().split()))
B=[0]*n
total=xsum(A)
for i in range(n):
    B[i]=total^A[i]
B_str=[str(i) for i in B]
print(' '.join(B_str))

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

for r in a:
	x ^= r
print(' '.join([str(x^r) for r in a]))

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

for r in a:
	x ^= r
a = [str(x^r) for r in a]
a = ' '.join(a)
print(a)

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ii()
a=ll()
xor=0
for i in a:
    xor^=i
for i in a:
    print(xor^i,end=" ")

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
a = LI()
xor = 0
for x in a:
    xor ^= x
for x in a:
    print(xor^x,end=' ')
print()

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    a = na()
    a_xor = 0
    for ai in a:
        a_xor ^= ai
    for ai in a:
        print(a_xor^ai, end=" ")

if __name__ == "__main__":
    main()

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

def nim(x):
  bx = [format(i,'030b') for i in x]
  bz = ''.join([str( sum([int(bx[xi][i]) for xi in range(len(x))]) % 2)  for i in range(30)])
  return int(bz, 2)

nima = nim(a)
ans = [ str(nim([nima,aa])) for aa in a ]
print(' '.join(ans) )

Solution (Python):
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

N=II()
a=LI()
A=0
for elem in a:
  A^=elem
ans=[A^elem for elem in a]
print(*ans)

Solution (Python):
from sys import stdin,stdout
LI=lambda:list(map(int,input().split()))
MAP=lambda:map(int,input().split())
IN=lambda:int(input())
S=lambda:input()
import math
from collections import Counter,defaultdict


n=IN()
a=LI()
ans=0
for i in range(n):
    ans^=a[i]
for i in range(n):
    print(ans^a[i],end=" ")

Solution (Python):
def II(): return int(input())
def LI(): return list(map(int, input().split()))
N=II()
a=LI()
A=0
for elem in a:
  A^=elem
ans=[elem^A for elem in a]
print(*ans)

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):
    print(S^a[i])

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(s^a[i])
print(*ans)

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+=str(x^a)+' '
print(ans)

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

all_xor = alphas[0] ^ alphas[1]
for i in range(2, N):
    all_xor = all_xor ^ alphas[i]
    
ans_list = []
for i in range(N):
    num_i = all_xor ^ alphas[i]
    ans_list.append(str(num_i))
    
ans = " ".join(ans_list)
print(ans)

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


if __name__ == "__main__":
    main()

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

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



ans = [""] * N
for i in range(N):
  ans[i] = str(tx ^ A[i])
  
print(" ".join(ans))

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
S=A[0]
B=[0 for i in range(N)]
for i in range(1,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()))

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

Solution (Python):
mod = int(1e9+7)
def add(a, b):
    c = a + b
    if c >= mod:
        c -= mod
    return c

def main():
    
    n = int(raw_input())
    
    arr = [int(x) for x in raw_input().split()]
    
    ans = [-1] * n
    
    total_xor = 0
    
    for num in arr:
        total_xor ^= num
    
    for i in range(n):
        ans[i] = total_xor ^ arr[i]
        ans[i] = str(ans[i])
    
    print(' '.join(ans))
    

main()

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

all_ = 0
for a in a_lst:
  all_ = all_ ^ a

for a in a_lst:
  print(all_ ^ a, end=' ')

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

    total = 0
    for other in a:
        total ^= other

    print(*[(other ^ total) for other in a])


if __name__ == "__main__":
    main()

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

Solution (Python):
from functools import reduce

n = int(input())
a = list(map(int,input().split()))
b = [0]*n
a_xor=reduce(lambda x,y : x^y,a)
for i in range(n):
  b[i]=a[i]^a_xor  


print(" ".join(list(map(str,b))))

Solution (Python):

import sys
input = lambda: sys.stdin.readline().strip()
n = int(input())
a = [int(x) for x in input().split()]
xor = 0
for x in a:
    xor ^= x
print(*(xor ^ x for x in a))

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

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

print(a[0] ^ s, end="")

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

Solution (Python):
import sys
import math
import collections

def set_debug(debug_mode=False):
    if debug_mode:
        fin = open('input.txt', 'r')
        sys.stdin = fin


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


def get(s):
    return str(s % 9) + '9' * (s // 9)

if __name__ == '__main__':
    

    
    t = 1

    for ti in range(1, t + 1):
        n = int(input())
        A = int_input()

        cur = 0

        for x in A:
            cur = x ^ cur

        res = []
        for x in A:
            res.append(cur ^ x)

        print(*res)

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

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

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

print(*b)

Solution (Python):

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

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

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

for x in A:
    xor ^= x

for v in  A:
    print(xor^v, end=' ')

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

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

if __name__ == '__main__':
    main()

Solution (Python):









import sys

def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]


OutV = lambda x: print(*x, sep='\n')

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)




def xors(num_lst):
  xor = 0
  for i in range(len(num_lst)):
    xor = xor ^ num_lst[i]
  return xor

N = iIn()
A = iInLH()

allxor = xors(A)
lst = []
for i in range(N):
    eachxor = allxor ^ A[i]
    lst.append(eachxor)

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

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

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

ans = 0
for i in range(n):
    ans = (ans ^ l[i])

for i in range(n):
    print(ans ^ l[i])

Solution (Python):
from sys import stdin

N = int(stdin.readline())
A = list(map(int,stdin.readline().split()))
xor=A[0]

for t in range(1,N):
    xor=xor^A[t]

for u in A:
    print(xor^u,end=' ')

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

Solution (Python):
n = int(input())
a = [int(an) for an in input().split()]

xor_all = 0
for an in a:
    xor_all = xor_all ^ an

anss = [str(xor_all ^ an) for an in a]
print(" ".join(anss))

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

Solution (Python):

N = int(input())
A = list(map(int,input().split()))
B = A[0]
for i in range(1,N):
    B = B^A[i]
ans = []
for i in range(N):
    ans.append(str(B^A[i]))

print(' '.join(ans))

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

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

out = []
for a in A:
    out.append(str(x ^ a))

print(' '.join(out))

Solution (Python):
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq

import bisect
import sys

sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    
    check=[False for _ in range(n)]
    check[s]=True
    
    queue=deque([s])
    visited_num=1

    
    
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        
        if len(queue)==0:
            
            
            return color

        now_vertex=queue.popleft()
        
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

mod=10**9+7



ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))

n=int(input())
tmp=list(map(int,input().split()))
a=[]
al=0
for each in tmp:
    al^=each
    a.append(each)

ans=[]
for each in (tmp):
    ans.append(str(each^al))

print(" ".join(ans))

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

x=0

for i in arr:
	x^=i


ans=[]

for i in arr:
	ans.append(x^i)

print(*ans)

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

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

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

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

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

ans = list()
for i in a:
	s = Xsum ^ i

	ans.append(str(s))

print(' '.join(ans))

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
t=0
for i in a[1:]:
    t^=i
print(t,end=" ")
for i in range(N-1):
    t^=a[i]
    t^=a[i+1]
    print(t,end=" ")

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

Solution (Python):
from functools import reduce

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

z = reduce(lambda x,y:x^y, A)
print(*[a^z for a in A], sep=' ')

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

Solution (Python):
def main():
        

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

    all_xor = A_s[0]

    for i in range(1, N):
        all_xor = (all_xor ^ A_s[i])

    ans_list = []

    for i in range(N):
        ans = (all_xor ^ A_s[i])
        ans_list.append(ans)

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


if __name__ == '__main__':
    main()

Solution (Python):



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


xor_sum = 0

for a in a_nums:
    xor_sum = xor_sum ^ a
ans = []


for a in a_nums:
    tmp = xor_sum ^ a
    ans.append(tmp)


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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    n=int(readline())
    a=list(map(int,readline().split()))

    b=[0]*n

    s_xor=0
    i_1=0
    i_2=0
    for j in range(n):
        if j==0:
            for _ in range(n-1):
                s_xor^=a[i_1]
                i_1+=1
            b[i_1]=s_xor
        else:
            s_xor^=a[i_2]
            i_2+=1
            i_2%=n

            s_xor^=a[i_1]
            i_1+=1
            i_1%=n
            b[i_1]=s_xor

    print(*b)

if __name__=="__main__":
    main()

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    a=LI()
    ALL=0
    for i in range(N):
        ALL=ALL^a[i]
        
    ans=[0]*N
    for i in range(N):
        ans[i]=ALL^a[i]
        
    print(' '.join(map(str, ans)))

main()

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):
input()
xors = [int(num) for num in input().strip().split(' ')]

totXor = xors[0]

for i in range(1, len(xors)): totXor ^= xors[i]

result = [totXor^xor  for xor in xors]

ans = "";
for result in result:
    ans += str(result)+ " "

print(ans.strip())

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    xor = 0
    for a in A:
        xor ^= a
    ans = [a ^ xor for a in A]
    print(*ans)
resolve()

Solution (Python):
import sys
import numpy as np
import math
import collections
from collections import deque 
from functools import reduce



n = int(input())
a = list(map(int, input().split()))
axor = 0
for ai in a:
    axor ^= ai
ans = []
for ni in range(n):
    ans.append(str(axor ^ a[ni]))
print(" ".join(ans))

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
xorsum = 0
for a in A:
    xorsum = xorsum^a
ans = [xorsum] * N
for i,a in enumerate(A):
    ans[i] = ans[i] ^ a
print(*ans)

Solution (Python):
n,*a = map(int,open(0).read().split())
all = 0
for i in a:
  all^=i
print(*[all^i for i in a])

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

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

print(" ".join([str(ai ^ a_xor) for ai in a]))

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


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

res = []

for a in A:
    res.append(a^x)

print(*res)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split(" ")]
t = a[0]
for i in a[1:]:
    t = t ^ i
ans = [t^i for i in a]
print(" ".join(map(str, ans)))

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

for i in range(N):
  if (i != 0):
    print(" ", end = "")
  print(S^aList[i], end = "")

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

n = int(input())
L = list(map(int,input().split()))
val = L[0]
for i in range(1,n):
    val ^= L[i]

ans = [val^i for i in L]
print(*ans)

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    flg = ["0"] * 40
    for i in range(40):
        cnt = 0
        for a in A:
            if (a >> i) & 1:
                cnt += 1
        if cnt % 2 != 0:
            flg[i] = "1"

    flg = int("".join(flg[::-1]), 2)
    res = [a ^ flg for a in A]
    print(*res)


if __name__ == '__main__':
    resolve()

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

Solution (Python):
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
import math

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	S = 0
	A = list(rli())
	for x in A:
		S ^= x
	ans = []
	for i in range(n):
		ans.append(S ^ A[i])
	print(" ".join(str(x) for x in ans))
	stdout.close()

if __name__ == "__main__":
	main()

Solution (Python):
import bisect

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


Sum_xor = a[0]
for i in range(N-1):
    Sum_xor = Sum_xor ^ a[i+1]
    

for i in range(N):
    print(Sum_xor ^ a[i])

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

total = 0
for num in S:
    total ^= num
ans = [0]*N
for i in range(N):
    ans[i] = total^S[i]
print(" ".join(map(str, ans)))

Solution (Python):
N = int(input())
a = 0
l = []
for i in map(int,input().split()):
  l.append(i)
  a = a ^ i
for i in l:
  print(a ^ i)