n=int(eval(input()))

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

ans=[0]*n

def f(x):

  c=[x[i-1]^x[i]for i in range(1,n)]

  k=[x[1:].count(1)%2]

  for i in c:

    k.append(k[-1]^i)

  return k

for i in range(31):

  t=1<<i

  x=[]

  for j in a:

    if t&j:x.append(1)

    else:x.append(0)

  m=f(x)

  for j in range(n):ans[j]+=t*m[j]

print((*ans))
n=int(eval(input()))

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

s=0

for i in a:s^=i

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


def f(x):
    c = [x[i - 1] ^ x[i] for i in range(1, n)]
    k = [x[1:].count(1) % 2]
    for i in c:
        k.append(k[-1] ^ i)
    return k


for i in range(31):
    t = 1 << i
    x = []
    for j in a:
        if t & j:
            x.append(1)
        else:
            x.append(0)
    m = f(x)
    for j in range(n):
        ans[j] += t * m[j]
print((*ans))

n = int(eval(input()))
a = list(map(int, input().split()))
s = 0
for i in a:
    s ^= i
for i in a:
    print((s ^ i))

-ans = [0] * n - - -def f(x): -    c = [x[i - 1] ^ x[i] for i in range(1, n)] -    k = [x[1:].count(1) % 2] -    for i in c: -        k.append(k[-1] ^ i) -    return k - - -for i in range(31): -    t = 1 << i -    x = [] -    for j in a: -        if t & j: -            x.append(1) -        else: -            x.append(0) -    m = f(x) -    for j in range(n): -        ans[j] += t * m[j] -print((*ans)) +s = 0 +for i in a: +    s ^= i +for i in a: +    print((s ^ i))