n = int(eval(input()))

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

b = []

for ai in a:

    b.append('{:0=30b}'.format(ai))



cnt = []

for j in range(30):

    tmp = 0

    for i in range(n):

        tmp += int(b[i][j])

    cnt.append(tmp)

ans = []

for bi in b:

    tmp = 0

    for i in range(30):

        idx = 29 + (-i)

        #print(idx)

        x = int(bi[i])

        if cnt[i] == 0:

            continue

        if cnt[i] % 2 == 0:

            tmp += x << idx

        else:

            if x == 0:

                tmp += 1 << idx

    ans.append(tmp)





#print(ans)

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



"""

0000010100

0000001011

0000001001

0000011000



0000011010

0000000101

0000000111

0000010110

"""
n = int(eval(input()))

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

b = []

s = 0

for ai in a:

    s ^= ai

ans = []

for ai in a:

    ans.append(s ^ ai)



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



n = int(eval(input()))
a = list(map(int, input().split()))
b = []
for ai in a:
    b.append("{:0=30b}".format(ai))
cnt = []
for j in range(30):
    tmp = 0
    for i in range(n):
        tmp += int(b[i][j])
    cnt.append(tmp)
ans = []
for bi in b:
    tmp = 0
    for i in range(30):
        idx = 29 + (-i)
        # print(idx)
        x = int(bi[i])
        if cnt[i] == 0:
            continue
        if cnt[i] % 2 == 0:
            tmp += x << idx
        else:
            if x == 0:
                tmp += 1 << idx
    ans.append(tmp)
# print(ans)
print((" ".join(map(str, ans))))
"""
0000010100
0000001011
0000001001
0000011000
0000011010
0000000101
0000000111
0000010110
"""

n = int(eval(input()))
a = list(map(int, input().split()))
b = []
s = 0
for ai in a:
    s ^= ai
ans = []
for ai in a:
    ans.append(s ^ ai)
print((" ".join(map(str, ans))))

+s = 0 -    b.append("{:0=30b}".format(ai)) -cnt = [] -for j in range(30): -    tmp = 0 -    for i in range(n): -        tmp += int(b[i][j]) -    cnt.append(tmp) +    s ^= ai -for bi in b: -    tmp = 0 -    for i in range(30): -        idx = 29 + (-i) -        # print(idx) -        x = int(bi[i]) -        if cnt[i] == 0: -            continue -        if cnt[i] % 2 == 0: -            tmp += x << idx -        else: -            if x == 0: -                tmp += 1 << idx -    ans.append(tmp) -# print(ans) +for ai in a: +    ans.append(s ^ ai) -""" -0000010100 -0000001011 -0000001001 -0000011000 -0000011010 -0000000101 -0000000111 -0000010110 -"""