import numpy as np

n=int(eval(input()))

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

C=A

A=np.array(A)

length=len(format(max(A),"b"))



B=""

for i in range(length):

    cnt=np.count_nonzero(A&1)

    if cnt%2==0:B +="0"

    else:B +="1"

    A >>=1



B=int(B[::-1],2)

D=[]

for i in C:

    D.append(B^i)

print((*D))
n=int(input())

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



num=0

for i in A:num ^=i

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

import numpy as np

n = int(eval(input()))
A = list(map(int, input().split()))
C = A
A = np.array(A)
length = len(format(max(A), "b"))
B = ""
for i in range(length):
    cnt = np.count_nonzero(A & 1)
    if cnt % 2 == 0:
        B += "0"
    else:
        B += "1"
    A >>= 1
B = int(B[::-1], 2)
D = []
for i in C:
    D.append(B ^ i)
print((*D))

n = int(input())
A = list(map(int, input().split()))
num = 0
for i in A:
    num ^= i
for i in A:
    print(num ^ i, end=" ")

-import numpy as np - -n = int(eval(input())) +n = int(input()) -C = A -A = np.array(A) -length = len(format(max(A), "b")) -B = "" -for i in range(length): -    cnt = np.count_nonzero(A & 1) -    if cnt % 2 == 0: -        B += "0" -    else: -        B += "1" -    A >>= 1 -B = int(B[::-1], 2) -D = [] -for i in C: -    D.append(B ^ i) -print((*D)) +num = 0 +for i in A: +    num ^= i +for i in A: +    print(num ^ i, end=" ")