n = int(eval(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))
n = int(eval(input()))

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

xora = 0

for i in range(n):

    xora = xora^a[i]

ans = []

for i in range(n):

    ans.append(xora^a[i])

print((*ans))
n = int(eval(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))

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

-an = [0 for i in range(30)] +xora = 0 +for i in range(n): +    xora = xora ^ a[i] -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) +for i in range(n): +    ans.append(xora ^ a[i])