#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache,reduce
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''✂'''''''''''''''''''''''''''''''''''''''''''''''''''''''''

n=int(input())
a=list(map(int,input().split()))
allxor=reduce(lambda x,y:x^y,a)
ans=[]
for i in range(n):
    ans.append(allxor^a[i])
print(*ans)

#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache,reduce
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''✂'''''''''''''''''''''''''''''''''''''''''''''''''''''''''

n=int(input())
a=list(map(int,input().split()))
allxor=reduce(lambda x,y:x^y,a)
ans=[]
for i in range(n):
    ans.append(allxor^a[i])
print(*ans)

#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆# ''✂