N = int(eval(input()))

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

A = A + A

ans = [0] * N

a = 0

for i in range(N-1):

    a ^= A[i]

ans[N-1] = a

W = N - 1

for i in range(N-1):

    remove = A[i]

    addition = A[i+W]

    a = remove^a^addition

    ans[i] = a



print((" ".join([str(i) for i in ans])))

N = int(eval(input()))

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



t = 0

for c in A:

    t ^= c



ans = []

for b in A:

    ans.append(t^b)



print((*ans))
N = int(eval(input()))
A = list(map(int, input().split()))
A = A + A
ans = [0] * N
a = 0
for i in range(N - 1):
    a ^= A[i]
ans[N - 1] = a
W = N - 1
for i in range(N - 1):
    remove = A[i]
    addition = A[i + W]
    a = remove ^ a ^ addition
    ans[i] = a
print((" ".join([str(i) for i in ans])))

N = int(eval(input()))
A = list(map(int, input().split()))
t = 0
for c in A:
    t ^= c
ans = []
for b in A:
    ans.append(t ^ b)
print((*ans))

-A = A + A -ans = [0] * N -a = 0 -for i in range(N - 1): -    a ^= A[i] -ans[N - 1] = a -W = N - 1 -for i in range(N - 1): -    remove = A[i] -    addition = A[i + W] -    a = remove ^ a ^ addition -    ans[i] = a -print((" ".join([str(i) for i in ans]))) +t = 0 +for c in A: +    t ^= c +ans = [] +for b in A: +    ans.append(t ^ b) +print((*ans))