n=int(eval(input()))

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

#print(bin(11^9^24))

B=bin(a[0])

for i in range(1,n):

    B=bin(int(str(B)[2:],2)^a[i])

for j in range(n):

    x=bin(int(str(B)[2:],2)^a[j])

    print((int(str(x)[2:],2)))
n=int(eval(input()))

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

#print(bin(11^9^24))

B=a[0]

for i in range(1,n):

    B=B^a[i]

ans=[]

for j in range(n):

    x=B^a[j]

    ans.append(x)

print((*ans))
n = int(eval(input()))
a = list(map(int, input().split()))
# print(bin(11^9^24))
B = bin(a[0])
for i in range(1, n):
    B = bin(int(str(B)[2:], 2) ^ a[i])
for j in range(n):
    x = bin(int(str(B)[2:], 2) ^ a[j])
    print((int(str(x)[2:], 2)))

n = int(eval(input()))
a = list(map(int, input().split()))
# print(bin(11^9^24))
B = a[0]
for i in range(1, n):
    B = B ^ a[i]
ans = []
for j in range(n):
    x = B ^ a[j]
    ans.append(x)
print((*ans))

-B = bin(a[0]) +B = a[0] -    B = bin(int(str(B)[2:], 2) ^ a[i]) +    B = B ^ a[i] +ans = [] -    x = bin(int(str(B)[2:], 2) ^ a[j]) -    print((int(str(x)[2:], 2))) +    x = B ^ a[j] +    ans.append(x) +print((*ans))