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):
"""
NTC here
"""
 
 

import os
import sys
from io import BytesIO, IOBase

profile = 0
pypy = 1
 
 
def iin(): return int(input())


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


def main():
    n = iin()
    a = lin()
    sm = 0
    for i in range(0, n, 2):
        sm = sm^a[i]^a[i+1]
    a = [i^sm for i in a]
    print(*a)






    




                

        

 
 
 
 
 
 

 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
if pypy:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
 

 
if __name__ == "__main__":
    if profile:
        import cProfile
        cProfile.run('main()')
    else:
        main()

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
total_xor = A[0]
for i in range(1, n):
    total_xor ^= A[i]
ans = []
_total_xor = int(total_xor)
for i in range(n):
    total_xor = _total_xor ^ A[i]
    ans.append(total_xor)

print(*ans)

Solution (Python):
n=int(input())
a=[int(x) for x in input().split()]
s=0
for c in a:
    s=s^c
b=[str(s^x) for x in a]
print(" ".join(b))

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

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

for a in A:
    print(xor_sum^a, end=" ")

Solution (Python):
import numpy as np
n = int(input())
aa = np.array(list(map(int, input().split())))
ret = np.zeros(n, int)
coeff = 1
while aa.sum() > 0:
    if ((aa%2).sum())%2 == 0:
        ret += coeff * (aa%2)
    else:
        ret += coeff * (1-aa%2)
    aa = aa//2
    coeff *= 2
ret = [str(r) for r in ret]
print(' '.join(ret))

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

ans = []
for ai in a:
    ans.append((s & ~ai) + (~s & ai))
print(*ans)

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

xorall = 0
for i in xorz:
    xorall ^= i

numx = [0]*N
for i in range(N):
    numx[i] = xorall ^ xorz[i]

for i in range(N):
    print(numx[i]),

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

xo = li[0]

for i in range(1, N):
    xo = xo ^ li[i]
for i in range(N):
    print(li[i] ^ xo, end = " ")

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  sm=l[0]
  for x in l[1:]:
    sm^=x

  ans=[]
  for x in l:
    sm^=x
    ans.append(sm)
    sm^=x

  return ' '.join(str(x) for x in ans)



print(main())

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = A[0]
    for i in range(1,N):
        B ^= A[i]

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

    print(*ans)

if __name__ == "__main__":
    main()

Solution (Python):
from math import log, ceil
def main():
    n = int(input())
    l = [int(j) for j in input().split()]
    x = 0
    for i in range(n):
        x = x^l[i]
    for i in range(n):
        print(x^l[i], end = " ")
    print()

    
        
        































































if __name__ == "__main__":
    main()

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(' '.join(map(str, ans)))

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

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

cnt = 0
for i in a:
    cnt ^= i
for i in a:
    print(cnt ^ i)

Solution (Python):

import collections
n = int(raw_input())
nums = map(int,raw_input().split(' '))
r = reduce(lambda x,y : x^y, nums)
print ' '.join(map(str,[r^bi for bi in nums]))

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

for i in range(n):
  print(S^num[i],end="")
  if i!=n:
    print(" ",end="")

Solution (Python):
from math import *
from collections import *
n=int(input())
a=list(map(int,input().split()))
x=0
for i in a:
    x=x^i
for i in a:
    print(x^i,end=" ")

Solution (Python):



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

n = int(input())
a = lmp()
num = 0
for i in range(n):
    num ^= a[i]
for i in range(n):
    print(num ^ a[i])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
s = 0
ans = []

for i in A:
  s ^= i

for i in A:
  ans.append(s^i)

print(*ans)

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

Solution (Python):
import sys
import math
def ReplaceElements(arr, n): 
  
    X = 0
  
    
    for i in range(n): 
        X ^= arr[i] 
  
    
    
    for i in range(n): 
        arr[i] = X ^ arr[i]
n=int(input())
a=list(map(int,input().split()))
ReplaceElements(a,n)
print(*a)

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

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


answer_list=[]
for a in alist:
  answer_list.append(a^xor_all)
  
print(*answer_list)

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())
a = [int(i) for i in input().split()]
s = a[0]
for i in range(1,n):
    s = s^a[i]

for i in range(n):
    if i != n-1:
        print(s^a[i],end = " ")
    else:
        print(s^a[i])

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

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

prefXor = [arr[0]]
for i in arr[1:]:
	prefXor += [prefXor[-1] ^ i]

out = []
for i in range(n):
	out += [prefXor[-1] ^ arr[i]]

print(*out)

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

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

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

al = 0

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

ans = []

for i in range(n):
    ans.append(al ^ a[i])

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

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

b = [0 for _ in range(len(a))]
xor = 0

for ai in a:
  xor ^= ai
  
b = 0
ans = ""
for j in range(len(a)):
  b = xor ^ a[j]
  ans += str(b)
  if j == len(a)-1:
    break
  ans +=" "

print(ans)

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

check = 0

for a in A:
    check ^= a

ans = []

for a in A:
    ans.append(str(a ^ check))

print(" ".join(ans))

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

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

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

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]
X=[]
for k in range(32):
    pp=0
    for a in A:
        pp+=(a>>k)&1
    if pp%2:
        for i in range(N):
            A[i]=A[i]^2**(k)
print(" ".join([str(x) for x in A]))

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
ans = []
total = 0
for aele in a:
    total = total ^ aele
for aele in a:
    print(total^aele, end=' ')
print()

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

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

x = a[0]
for i in range(n-1):
    x = x^a[i+1]
ans = []
if n % 2 == 0:
    for i in range(n):
        pp = a[i]^x
        ans.append(pp)
else:
    ans = a
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
an = [0 for i in range(30)]
ans = []
for i in a:
    c = bin(i)
    d = len(c)-1
    count = 0
    while c[d] != 'b':
        if c[d] == '1':
            an[count] += 1
            an[count] %= 2
        d-=1
        count+=1
tmp = 0
for i in range(len(an)):
    if an[i] == 1:
        tmp += 2**i
for i in a:
    ans.append(i ^ tmp)
print(*ans)

Solution (Python):
import itertools
import decimal
import math
from collections import Counter
import sys
input = sys.stdin.readline

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

master=0
for i in range(N):
    master=master^ListA[i]
    



for i in range(N):
    print(master^ListA[i],end=" ")

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

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

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

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

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

Ans = [0 for i in range(N)]

X = 0

for i in A:
  X ^= i

for i in range(N):
  Ans[i] = X ^ A[i]
print(*Ans)

Solution (Python):
def main():
    N = int(input())
    l = [int(x) for x in input().split()]
    a_all = l[0]
    for i in l[1:]:
        a_all = a_all^i
    for i in l:
        print(i^a_all)
main()

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

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

for ai in a:
    x ^= ai

ans = []

for ai in a:
    ans.append(ai^x)

print(*ans)

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

left = [0] * (N+1)
right = [0] * (N+1)

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

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

ans = []
for i in range(N):
    if i-1 >= 0:
        l = left[i-1]
    else:
        l = 0
    if i+1 < N:
        r = right[i+2]
    else:
        r = 0
    ans.append(l^r)
print(*ans, sep=" ")

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

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

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

print(*ans)

Solution (Python):
import sys
input = sys.stdin.readline
from itertools import accumulate
from functools import reduce
from operator import xor, add


def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A):
    L = list(accumulate(A, xor))
    R = list(accumulate(A[::-1], xor))[::-1]
    ans = [0 for i in range(N)]
    for i in range(N):
        a = 0
        l = L[i-1] if i > 0 else 0
        a ^= l
        r = R[i+1] if i+1 < N else 0
        a ^= r
        ans[i] = a
    print(*ans)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()

N=int(input())
A=list(map(int,input().split()))
lst=[]
for i in range(0,N,2):
    lst.append(A[i]^A[i+1])

z=0
for l in lst:
    z^=l

rlst=[]

for i in range(N):
    rlst.append(z^lst[i//2]^A[i+(1 if (i&1==0) else -1)])
    
print(" ".join([str(i) for i in rlst]))

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



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

xor = A[0]
for i in range(1,len(A)):
  xor ^= A[i]
  
ans = [-1] * N
for i in range(N):
  ans[i] = A[i] ^ xor
  
print(*ans)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]
n = 0
for i in a:
    n ^= i
b = 1
ans = [0]*N
for _ in range(30):
    for i,v in enumerate(a):
        ans[i] += (v & b) ^ (n & b)
    b <<= 1
print(*ans)

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()
    a = LI()

    x = 0
    for b in a:
        x ^= b
    ans = []
    for b in a:
        ans.append(x^b)
    print(*ans,sep=' ')


if __name__ == '__main__':
    main()

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

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

print(' '.join([str(x ^ a) for a in A]))

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    A = [int(a) for a in input().split()]
    total = 0
    for a in A:
        total ^= a
    Ans = [-1] * N
    for i, a in enumerate(A):
        Ans[i] = total ^ a
    print(*Ans, sep = " ")

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
ret=[0]*n
now=1
for i in range(max(l).bit_length()):
    z=0
    for j in range(n):
        if l[j]%2:
            z+=1
    for j in range(n):
        ret[j]+=(l[j]%2+z)%2*now
        l[j]//=2
    now*=2
print(*ret,sep=" ")

Solution (Python):
input()
a = [int(x) for x in input().split()]
c = 0

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

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

ALL=0
for i in L:
    ALL^=i

ans=[]
for i in L:
    ans.append(ALL^i)
print(*ans)

Solution (Python):

n = int(input())
a = list(map(int, input().split()))
l = [0] * (n + 2)
for i in range(n):
    l[i + 1] = l[i] ^ a[i]
r = [0] * (n + 2)
for i in range(1, n + 1)[::-1]:
    r[i] = r[i + 1] ^ a[i - 1]
ans = [0] * n
for i in range(n):
    ans[i] = l[i] ^ r[i + 2]
print(*ans, sep=" ")

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")

EPS = 1e-8


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

    T = 0
    for a in A:
        T ^= a
    print(" ".join([str(T ^ a) for a in A]))

    return


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

n = INT()
a = LIST()
m = a[0] ^ a[1]
for i in range(2, n):
    m = m ^ a[i]
ans = []
for i in range(n):
    ans.append(str(m ^ a[i]))

print(' '.join(ans))

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    """
    (N-1)
    (a_1^a_2^...^a_n)**(N-1) = a_1^a_2^...^a_n
    """
    N = read_int()
    A = read_ints()
    total = 0
    for a in A:
        total ^= a
    return ' '.join(map(str, (total^a for a in A)))


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

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

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

ans=[s^x for x in a]

print(*ans,sep=' ')

Solution (Python):
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return result



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    bit_value = xor_operate(a_list)

    i_list = []
    for a in a_list:
        i_list.append(str(bit_value ^ int(a)))
    print(" ".join(i_list))

Solution (Python):
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()



def solve():
    n = inp()
    a = inlt()
    q = 0
    for i in range(len(a)):
        q = q ^ a[i]
    for i in range(len(a)):
        a[i] = a[i] ^ q
    print(*a)
            


 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 

def counter(a):
    q = [0] * 100000
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
    return(q)


ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()

def main():
    N=ii()
    A = list(mi())

    xsum = A[0]
    for a in A[1:]:
        xsum ^=a

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

    print(*ans,sep=' ')


if __name__ == "__main__":
  main()

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

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

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

for i in range(N):
	R.append(pre^suff)
	pre ^= A[i]

	if i != N-1:
		suff ^= A[i+1]
	else:
		suff = 0

print(*R)

Solution (Python):
n = int(input())
aa = tuple(map(int, input().split()))

v = aa[0]
for i in range(1, n):
    v ^= aa[i]
print(' '.join([str(v ^ a) for a in aa]))

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

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

ans = [0]*n
for i, a in enumerate(A):
    ans[i] = t^a
print(*ans)

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

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


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

Solution (Python):
n = int(input())
a = []
s = 0
for x in input().split():
    s ^= int(x)
    a.append(int(x))
ans = []
for x in a:
    ans.append(str(x^s))
print(' '.join(ans))

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
xor=[]
for i in range(n-1):
    xor.append(a[i]^a[i+1])
f=0
for i in range(0,len(xor),2):
    f^=xor[i]
first=f^a[0]
ans=[first]
k=first
print(first,end=' ')
for i in xor:
    print(k^i,end=' ')
    k=k^i

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

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

T=[]
for a in A:
    T.append(S^a)

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

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

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

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

result = []
for a in A:
    result += [str(total_xor ^ a)]
print(' '.join(result))

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

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

Solution (Python):
import sys
import itertools

import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines




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

ans = [0] * n





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

for i in range(n):
    ans[i] = total ^ A[i]
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
s = a[0]
for i in range(1, n):
    s = s ^ a[i]
l = []
for i in range(n):
    l.append(s ^ a[i])
print(" ".join(map(str,l)))

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

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

total = 0

for item in a:
    total = total ^ item

ret = []

for item in a:
    ret.append(total ^ item)

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

Solution (Python):
N = int(input())
A = list(map(int,input().rstrip().split(" ")))
bit = [0 for i in range(32)]
for i in range(32):
    for i2 in A:
        if (i2 >> i) & 1:
            bit[i] += 1
ans = [0 for i in range(len(A))]
for i in range(32):
    for i2 in range(len(A)):
        if bit[i] % 2 == 0:
            if (A[i2] >> i) & 1:
                ans[i2] += 2 ** i
        else:
            if not (A[i2] >> i) & 1:
                ans[i2] += 2 ** i
print(" ".join(map(str,ans)))

Solution (Python):
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return result



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    bit_value = xor_operate(a_list)

    i_list = []
    for a in a_list:
        i_list.append(str(bit_value ^ int(a)))
    print(" ".join(i_list))

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 8)

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    A = ZZ()
    x = 0
    for a in A: x ^= a
    ans = []
    for a in A:
        ans.append(a ^ x)
    print(*ans)


    return

if __name__ == '__main__':
    main()

Solution (Python):
from functools import reduce

N, *A = map(int, open(0).read().split())

S = reduce(lambda a, b: a ^ b, A)

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

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

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

total = 0
for a in A:
    total = total ^ a
ans = [total ^ a for a in A]
print(' '.join(map(str, ans)))

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

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

A_all = 0
for i, Ai in enumerate(A):
    A_all ^= Ai

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

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

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

all_xor = 0
for a in a_list:
    all_xor ^= a
ans = []
for a in a_list:
    ans.append(all_xor ^ a)
    
print(" ".join([str(el) for el in ans]))

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

all = 0
for v in a:
    all ^= v
nums = []
for v in a:
    nums.append(str(all ^ v))
print(" ".join(nums))

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(str(x ^ _a))

print(" ".join(ans))

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()))
x = 0
for i in a:
  x ^= i
aa = []
for i in a:
  aa.append(x^i)
print(*aa)

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

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

print(' '.join([str(k ^ s) for k in a]))

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

xor_all = 0

for ai in a:
    xor_all ^= ai

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

Solution (Python):
import sys

N = int(sys.stdin.readline())
A = [int(x) for x in sys.stdin.readline().split()]

tmp = 0

for a in A:
    tmp ^= a

ANS = []
for a in A:
    ANS.append(tmp^a)

print(" ".join([str(x) for x in ANS]))

Solution (Python):
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft



def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = [[] for i in range(n)]
    for i in range(60):
        c = 0
        for x in a:
            if (x >> i) & 1:
                c ^= 1
        for j in range(n):
            x = (a[j] >> i) & 1
            b[j].append(x ^ c)

    for x in b:
        print(int("".join(str(i) for i in x[::-1]), 2))
main()

Solution (Python):
n = int(input())
A = tuple(map(int, input().split()))
from functools import reduce
AXOR = reduce(lambda x, y: x^y, A)

xor = []
for a in A:
    xor.append(str(AXOR^a))
print(' '.join(xor))

Solution (Python):
import sys

input = sys.stdin.readline


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

    all_xor = A[0]
    for a in A[1:]:
        all_xor = all_xor ^ a

    ans = [a ^ all_xor for a in A]
    print(" ".join(map(str, ans)))


if __name__ == "__main__":
    main()

Solution (Python):
import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
l=[0]*35
for i in range(n):
    for j in range(35):
        if (a[i]>>j)%2==1:
            if l[j]==0:
                l[j]=1
            else:
                l[j]=0
ans=[]
for i in range(n):
    temp=0
    for j in range(35):
        if (a[i]>>j)%2==1:
            if l[j]==0:
                temp+=2**j
        else:
            if l[j]==1:
                temp+=2**j
    ans.append(temp)

for i in ans:
    print(i,end='')
    print(' ',end='')

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
L = []
x=0
for a in A:
    x ^= a
    L.append(x)
R = []
x=0
for a in reversed(A):
    x ^= a
    R.append(x)
for i in range(n):
    x = 0
    if i>0:
        x^=L[i-1]
    if i<n-1:
        x^=R[n-1-(i+1)]
    print(x, end="")
    if i==n-1:
        print("")
    else:
        print(" ",end="")

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

aa = 0

for i in range(1,len(List)):
  a = List[i]
  aa = aa ^ a
  

bb = List[0]
arr = [aa]
for i in range(1,len(List)):
  a = List[i]
  b = bb ^ a
  c = b ^ aa
  arr.append(c)
  
print(*arr)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
t = 0
for i in range(N):
    t = t ^ a[i]
b = []
for i in range(N):
    b.append(t ^ a[i])
print(*b, sep=' ')

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

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

Solution (Python):
import sys


def _i(): return int(sys.stdin.readline().strip())


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


def main():
    _ = _i()
    a = list(_ia())
    s = 0
    for ai in a:
        s ^= ai

    return " ".join(map(str, map(lambda x: s^x, a)))


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