Problem:
 Score : 500 points    Problem Statement There are N Snuke Cats numbered 1, 2, \ldots, N , where N is even .  Each Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.  Recently, they learned the operation called xor (exclusive OR).   What is xor?  For n non-negative integers x_1, x_2, \ldots, x_n , their xor, x_1~\textrm{xor}~x_2~\textrm{xor}~\ldots~\textrm{xor}~x_n is defined as follows:  When x_1~\textrm{xor}~x_2~\textrm{xor}~\ldots~\textrm{xor}~x_n is written in base two, the digit in the 2^k 's place ( k \geq 0 ) is 1 if the number of integers among x_1, x_2, \ldots, x_n whose binary representations have 1 in the 2^k 's place is odd, and 0 if that count is even.  For example, 3~\textrm{xor}~5 = 6 .   They wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.  We know that the xor calculated by Snuke Cat i , that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i .
Using this information, restore the integer written on the scarf of each Snuke Cat.      Constraints  All values in input are integers.  2 \leq N \leq 200000  N is even .  0 \leq a_i \leq 10^9  There exists a combination of integers on the scarfs that is consistent with the given information.         Input Input is given from Standard Input in the following format:  N  a_1  a_2  \ldots  a_N       Output Print a line containing N integers separated with space.  The i -th of the integers from the left should represent the integer written on the scarf of Snuke Cat i .  If there are multiple possible solutions, you may print any of them.        Sample Input 1 4
20 11 9 24      Sample Output 1 26 5 7 22   5~\textrm{xor}~7~\textrm{xor}~22 = 20  26~\textrm{xor}~7~\textrm{xor}~22 = 11  26~\textrm{xor}~5~\textrm{xor}~22 = 9  26~\textrm{xor}~5~\textrm{xor}~7 = 24   Thus, this output is consistent with the given information.

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 

from decimal import *



N = INT()
a = LIST()

all_xor = a[0]
for x in a[1:]:
	all_xor ^= x

for x in a:
	print(all_xor^x, end=" ")
print()

Solution (Python):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))

    all_xor = 0
    for ai in a:
        all_xor ^= ai

    ans = []

    for ai in a:
        ans.append(str(all_xor ^ ai))

    print(' '.join(ans))

resolve()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
S = 0
for x in A:
    S ^= x
for i in range(len(A)):
    A[i] ^= S
print(*A)

Solution (Python):

N = int(input())
X = list(map(int, input().split()))

total = 0
for a in X:
    total ^= a

ans = []
for a in X:
    ans.append(a ^ total)

print(*ans)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
S=0
for i in range(N):
  S^=a[i]
b=[0]*N
for i in range(N):
  b[i]=S^a[i]

print(*b)

Solution (Python):
N=int(input())
array=[int(x) for x in input().split()]
XOR=0
for i in array:
	XOR=XOR^i
print(*[XOR^x for x in array])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

x = 0
for a in A:
    x ^= a

ans = []
for a in A:
    ans.append(x ^ a)

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

Solution (Python):
n = int(input())
A = list(map(int,input().split()))

xor_sum = 0
for i in range(n):
    xor_sum = xor_sum^A[i]

ans = []
for i in range(n):
    ans.append(xor_sum^A[i])
print(' '.join(map(str,ans)))

Solution (Python):
n = int(input())
A = list(map(int, input().split()))

t = 0
for a in A:
    t ^= a
ans = []
for a in A:
    ans += [t ^ a]
    
print(*ans, sep=" ")

Solution (Python):
from functools import reduce

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

b = reduce(lambda ac, x: ac ^ x, a)
print(*map(lambda x: x ^ b, a))

Solution (Python):
from functools import reduce

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

b = reduce(lambda ac, x: ac ^ x, a)
print(*map(lambda x: x ^ b, a))

Solution (Python):
from functools import reduce

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

b = reduce(lambda acc, cur: acc ^ cur, a[1:], a[0])
print(*map(lambda x: x ^ b, a))

Solution (Python):
from functools import reduce

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

b = reduce(lambda acc, x: acc ^ x, a[1:], a[0])
print(*map(lambda x: x ^ b, a))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

b = a[0]
for v in a[1:]:
    b ^= v
print(*map(lambda x: x ^ b, a))

Solution (Python):
N, *D = map(int, open(0).read().split())
ALL = 0
for d in D:
  ALL ^= d
D = map(lambda x: x ^ ALL, D)
print(*D, sep=' ')

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
for i in range(N):
    if i == 0:
        tmp = a[i]
    else:
        tmp = tmp ^ a[i]
ans = []
for i in range(N):
    ans.append(tmp ^ a[i])
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = [None]*n
all = 0

for i in range(n):
    all = all^a[i]

for i in range(n):
    ans[i]=str(all^a[i])
print(' '.join(ans))

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(0,n,2):
    B.append(A[i]^A[i+1])

s=0
for b in B:
    s^=b

X=[s^a for a in A]
print(*X)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(N):
    s ^= a[i] 
for i in range(N):
    a[i] ^= s
for i in range(N):
    print(a[i])

Solution (Python):
import sys
import numpy as np
from heapq import heappush, heappop 
from bisect import bisect_left as bi_l, bisect_right as bi_r
from collections import deque, Counter, defaultdict
from itertools import combinations, product
inf = float('inf')
MOD = 10**9+7



class NumberTheory():
  def __init__(self, n=2*10**6, numpy=True):
    self.n = n
    self.np_flg = numpy 
    self.is_prime_number, self.prime_numbers = self.sieve_of_eratosthenes(n)
  
  def sieve_of_eratosthenes(self, n):
    if self.np_flg:
      sieve = np.ones(n+1, dtype=np.int64); sieve[:2] = 0
      for i in range(2, int(n**.5)+1):
        if sieve[i]: sieve[i*2::i] = 0
      prime_numbers = np.flatnonzero(sieve)
    else:
      sieve = [1] * (n+1); sieve[0] = sieve[1] = 0
      for i in range(2, int(n**.5)+1):
        if not sieve[i]: continue
        for j in range(i*2, n+1, i): sieve[j] = 0
      prime_numbers = [i for i in range(2, n+1) if sieve[i]]
    return sieve, prime_numbers 

  def prime_factorize(self, n):
    res = dict()
    if n < 2: return res
    border = int(n**.5)
    for p in self.prime_numbers:
      if p > border: break
      while n % p == 0: res[p] = res.get(p, 0)+1; n //= p
      if n == 1: return res
    res[n] = 1; return res

  def prime_factorize_factorial(self, n):
    res = dict()
    for i in range(2, n+1):
      for p, c in self.prime_factorize(i).items(): res[p] = res.get(p, 0)+c
    return res
  
  @staticmethod
  def gcd(a, b): return gcd(b, a%b) if b else abs(a)

  @staticmethod
  def lcm(a, b): return abs(a // gcd(a, b) * b)

  @staticmethod
  def find_divisors(n):
    divisors = []
    for i in range(1, int(n**.5)+1):
      if n%i: continue
      divisors.append(i)
      j = n // i
      if j != i: divisors.append(j)
    return divisors
  
  @staticmethod
  def base_convert(n, b):
    if not n: return [0]
    res = []
    while n:
      n, r = divmod(n, b)
      if r < 0: n += 1; r -= b
      res.append(r)
    return res


class UnionFind():
  def __init__(self, n=10**6):
    self.root = list(range(n))
    self.height = [0] * n 
    self.size = [1] * n 
  
  def find_root(self, u):
    if self.root[u] == u: return u
    self.root[u] = self.find_root(self.root[u])
    return self.root[u]
  
  def unite(self, u, v):
    ru = self.find_root(u)
    rv = self.find_root(v)
    if ru == rv: return 
    hu = self.height[ru]
    hv = self.height[rv]
    if hu >= hv:
      self.root[rv] = ru 
      self.size[ru] += self.size[rv]
      self.height[ru] = max(hu, hv+1)
    else:
      self.root[ru] = rv 
      self.size[rv] += self.size[ru]


class Combinatorics():
  def __init__(self, N=10**9, n=10**6, mod=10**9+7, numpy=True):
    self.mod = mod
    self.nCr = dict()
    self.np_flg=numpy
    self.make_mod_tables(N, n)

  sys.setrecursionlimit(10**6)
  def choose(self, n, r, mod=None): 
    if r > n or r < 0: return 0
    if r == 0: return 1
    if (n, r) in self.nCr: return self.nCr[(n, r)]
    if not mod:
      self.nCr[(n, r)] = (self.choose(n-1, r) + self.choose(n-1, r-1))
    else:
      self.nCr[(n, r)] = (self.choose(n-1, r, mod) + self.choose(n-1, r-1, mod)) % mod
    return self.nCr[(n,r)]
  
  def cumprod(self, a):
    p = self.mod
    l = len(a); sql = int(np.sqrt(l)+1)
    a = np.resize(a, sql**2).reshape(sql, sql)
    for i in range(sql-1): a[:, i+1] *= a[:, i]; a[:, i+1] %= p
    for i in range(sql-1): a[i+1] *= a[i, -1]; a[i+1] %= p
    return np.ravel(a)[:l]

  def make_mod_tables(self, N, n):
    p = self.mod
    if self.np_flg:
      fac = np.arange(n+1); fac[0] = 1; fac = self.cumprod(fac)
      ifac = np.arange(n+1, 0, -1); ifac[0] = pow(int(fac[-1]), p-2, p)
      ifac = self.cumprod(ifac)[n::-1]
      n_choose = np.arange(N+1, N-n, -1); n_choose[0] = 1;
      n_choose[1:] = self.cumprod(n_choose[1:])*ifac[1:n+1]%p
    else:
      fac = [None]*(n+1); fac[0] = 1
      for i in range(n): fac[i+1] = fac[i]*(i+1)%p
      ifac = [None]*(n+1); ifac[n] = pow(fac[n], p-2, p)
      for i in range(n, 0, -1): ifac[i-1] = ifac[i]*i%p
      n_choose = [None] * (n+1); n_choose[0] = 1
      for i in range(n): n_choose[i+1] = n_choose[i]*(N-i)%p
      for i in range(n+1): n_choose[i] = n_choose[i]*ifac[i]%p
    self.fac, self.ifac, self.mod_n_choose = fac, ifac, n_choose


def z_algorithm(s):
  n = len(s)
  a = [0] * n; a[0] = n
  l = r = -1
  for i in range(1, n):
    if r >= i: a[i] = min(a[i-l], r-i)
    while i + a[i] < n and s[i+a[i]] == s[a[i]]: a[i] += 1
    if i+a[i] >= r: l, r = i, i+a[i]
  return a


class ABC001():
  def A():
    h1, h2 = map(int, sys.stdin.read().split())
    print(h1-h2)

  def B(): pass
  def C(): pass 
  def D(): pass 


class ABC002():
  def A():
    x, y = map(int, sys.stdin.readline().split())
    print(max(x, y))

  def B():
    vowels = set('aeiou')
    s = sys.stdin.readline().rstrip() 
    t = ''
    for c in s:
      if c in vowels: continue 
      t += c 
    print(t)

  def C():
    *coords, = map(int, sys.stdin.readline().split())
    def triangle_area(x0, y0, x1, y1, x2, y2):
      x1 -= x0; x2 -= x0; y1 -= y0; y2 -= y0;
      return abs(x1*y2 - x2*y1) / 2
    print(triangle_area(*coords))

  def D():
    n, m = map(int, sys.stdin.readline().split())
    edges = set()
    for _ in range(m):
      x, y = map(int, sys.stdin.readline().split())
      x -= 1; y -= 1
      edges.add((x, y))
    cand = []
    for i in range(1, 1<<n):
      s = [j for j in range(n) if i>>j & 1]
      for x, y in combinations(s, 2):
        if (x, y) not in edges: break
      else:
        cand.append(len(s))
    print(max(cand))


class ABC003():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print((n+1)*5000)

  def B():
    atcoder = set('atcoder')
    s, t = sys.stdin.read().split()
    for i in range(len(s)):
      if s[i] == t[i]: continue
      if s[i] == '@' and t[i] in atcoder: continue 
      if t[i] == '@' and s[i] in atcoder: continue
      print('You will lose')
      return 
    print('You can win')

  def C():
    n, k, *r = map(int, sys.stdin.read().split())
    res = 0
    for x in sorted(r)[-k:]:
      res = (res+x) / 2
    print(res)

  def D(): pass 


class ABC004():
  def A():
    print(int(sys.stdin.readline().rstrip())*2)

  def B():
    c = [sys.stdin.readline().rstrip() for _ in range(4)]
    for l in c[::-1]:
      print(l[::-1])

  def C():
    n = int(sys.stdin.readline().rstrip())
    n %= 30
    res = list(range(1, 7))
    for i in range(n):
      i %= 5
      res[i], res[i+1] = res[i+1], res[i]
    print(''.join(map(str, res)))

  def D(): pass 


class ABC005():
  def A():
    x, y = map(int, sys.stdin.readline().split())
    print(y//x)

  def B():
    n, *t = map(int, sys.stdin.read().split())
    print(min(t))

  def C():
    t = int(sys.stdin.readline().rstrip())
    n = int(sys.stdin.readline().rstrip())
    a = [int(x) for x in sys.stdin.readline().split()]
    m = int(sys.stdin.readline().rstrip())
    b = [int(x) for x in sys.stdin.readline().split()]
    i = 0
    for p in b:
      if i == n: print('no'); return 
      while p-a[i] > t:
        i += 1
        if i == n: print('no'); return 
      if a[i] > p: print('no'); return 
      i += 1
    print('yes')

  def D():
    n = int(sys.stdin.readline().rstrip())
    d = np.array([sys.stdin.readline().split() for _ in range(n)], np.int64)
    s = d.cumsum(axis=0).cumsum(axis=1)
    s = np.pad(s, 1)
    max_del = np.zeros((n+1, n+1), dtype=np.int64)
    for y in range(1, n+1):
      for x in range(1, n+1):
        max_del[y, x] = np.amax(s[y:n+1, x:n+1] - s[0:n-y+1, x:n+1] - s[y:n+1, 0:n-x+1] + s[0:n-y+1, 0:n-x+1])
    res = np.arange(n**2+1)[:, None]
    i = np.arange(1, n+1)
    res = max_del[i, np.minimum(res//i, n)].max(axis=1)
    q = int(sys.stdin.readline().rstrip())
    p = np.array(sys.stdin.read().split(), dtype=np.int64)
    print(*res[p], sep='\n')


class ABC006():
  def A():
    n = sys.stdin.readline().rstrip()
    if '3' in n: print('YES')
    elif int(n)%3 == 0: print('YES')
    else: print('NO')

  def B():
    mod = 10007
    t = [0, 0, 1]
    for _ in range(1001001):
      t.append(t[-1]+t[-2]+t[-3]); t[-1] %= mod
    n = int(sys.stdin.readline().rstrip())
    print(t[n-1])
    
  def C():
    n, m = map(int, sys.stdin.readline().split())
    cnt = [0, 0, 0]
    if m == 1: cnt = [-1, -1, -1]
    else:
      if m & 1: m -= 3; cnt[1] += 1; n -= 1
      cnt[2] = m//2 - n 
      cnt[0] = n - cnt[2]
    if cnt[0]<0 or cnt[1]<0 or cnt[2]<0: print(-1, -1, -1)
    else: print(*cnt, sep=' ')
      
  def D():
    n, *c = map(int, sys.stdin.read().split())
    lis = [inf]*n 
    for x in c: lis[bi_l(lis, x)] = x 
    print(n - bi_l(lis, inf))


class ABC007():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print(n-1)

  def B():
    s = sys.stdin.readline().rstrip()
    if s == 'a': print(-1)
    else: print('a')

  def C():
    r, c = map(int, sys.stdin.readline().split())
    sy, sx = map(int, sys.stdin.readline().split())
    gy, gx = map(int, sys.stdin.readline().split())
    sy -= 1; sx -=1; gy -= 1; gx -= 1
    maze = [sys.stdin.readline().rstrip() for _ in range(r)]
    queue = deque([(sy, sx)])
    dist = np.full((r, c), np.inf); dist[sy, sx] = 0
    while queue:
      y, x = queue.popleft()
      for i, j in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        i += y; j += x
        if maze[i][j] == '
        dist[i, j] = dist[y, x] + 1
        queue.append((i, j))
    print(int(dist[gy, gx]))
  
  def D(): pass 


class ABC008():
  def A():
    s, t = map(int, sys.stdin.readline().split())
    print(t-s+1)

  def B():
    n, *s = sys.stdin.read().split()
    res = defaultdict(int)
    for name in s: res[name] += 1
    print(sorted(res.items(), key=lambda x: x[1])[-1][0])

  def C():
    n, *a = map(int, sys.stdin.read().split())
    a = np.array(a)
    c = n - np.count_nonzero(a[:, None]%a, axis=1)
    print(np.sum((c+1)//2/c))
  
  def D(): pass

class ABC009():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print((n+1)//2)

  def B():
    n, *a = map(int, sys.stdin.read().split())
    print(sorted(set(a))[-2])
    
  def C():
    n, k = map(int, sys.stdin.readline().split())
    s = list(sys.stdin.readline().rstrip())
    cost = [1]*n
    r = k
    for i in range(n-1):
      q = []
      for j in range(i+1, n):
        if s[j] < s[i] and cost[i]+cost[j] <= r:
          heappush(q, (s[j], cost[i]+cost[j], -j))
      if not q: continue
      _, c, j = heappop(q); j = -j 
      s[i], s[j] = s[j], s[i]
      r -= c 
      cost[i] = cost[j] = 0
    print(''.join(s))
      
  def D(): pass 


class ABC010():
  def A():
    print(sys.stdin.readline().rstrip()+'pp')
  def B():
    n, *a = map(int, sys.stdin.read().split())
    tot = 0
    for x in a:
      c = 0 
      while x%2==0 or x%3==2:
        x -= 1
        c += 1
      tot += c
    print(tot)

  def C():
    sx, sy, gx, gy, t, v, n, *xy = map(int, sys.stdin.read().split())
    x, y = np.array(xy).reshape(-1, 2).T
    def dist(x1, y1, x2, y2):
      return np.sqrt((x2-x1)**2 + (y2-y1)**2)
    ans = 'YES' if (dist(sx, sy, x, y)+dist(x, y, gx, gy) <= v*t).any() else 'NO'
    print(ans)

  def D(): pass 

class ABC011():
  def A():
    n = int(sys.stdin.readline().rstrip())
    print(n%12+1)

  def B():
    s = sys.stdin.readline().rstrip() 
    print(s[0].upper()+s[1:].lower())

  def C():
    n, *ng = map(int, sys.stdin.read().split())
    ng = set(ng)
    if n in ng: print('NO')
    else:
      r = 100
      while n > 0:
        if r == 0: print('NO'); return
        for i in range(3, 0, -1):
          if (n-i) in ng: continue 
          n -= i
          r -= 1
          break 
        else: print('NO'); return 
      print('YES')

  def D(): pass 


class ABC170():
  def A():
    x = [int(x) for x in sys.stdin.readline().split()]
    for i in range(5):
      if x[i] != i+1:
        print(i+1)
        break

  def B():
    x, y = map(int, sys.stdin.readline().split())
    print('Yes' if 2*x <= y <= 4*x and y%2 == 0 else 'No')
      
  def C():
    x, n, *p = map(int, sys.stdin.read().split())
    a = list(set(range(102)) - set(p))
    a = [(abs(y-x), y) for y in a]
    print(sorted(a)[0][1])

  def D():
    n, *a = map(int, sys.stdin.read().split())
    cand = set(a)
    cnt = 0
    for x, c in sorted(Counter(a).items()):
      cnt += c == 1 and x in cand
      cand -= set(range(x*2, 10**6+1, x))
    print(cnt)

  def E():
    n, q = map(int, sys.stdin.readline().split())
    queue = [] 
    num_kindergarten = 2*10**5
    queue_kindergarten = [[] for _ in range(num_kindergarten)]
    highest_kindergarten = [None] * num_kindergarten
    where = [None] * n
    rate = [None] * n

    def entry(i, k):
      where[i] = k
      while queue_kindergarten[k]:
        r, j = heappop(queue_kindergarten[k])
        if where[j] != k or j == i: continue 
        if rate[i] >= -r:
          highest_kindergarten[k] = rate[i]
          heappush(queue, (rate[i], k, i))
        heappush(queue_kindergarten[k], (r, j))
        break
      else:
        highest_kindergarten[k] = rate[i]
        heappush(queue, (rate[i], k, i))
      heappush(queue_kindergarten[k], (-rate[i], i))

    def transfer(i, k):
      now = where[i]
      while queue_kindergarten[now]:
        r, j = heappop(queue_kindergarten[now])
        if where[j] != now or j == i: continue
        if highest_kindergarten[now] != -r:
          highest_kindergarten[now] = -r
          heappush(queue, (-r, now, j))
        heappush(queue_kindergarten[now], (r, j))
        break
      else:
        highest_kindergarten[now] = None
      entry(i, k)

    def inquire():
      while True:
        r, k, i = heappop(queue)
        if where[i] != k or r != highest_kindergarten[k]: continue 
        heappush(queue, (r, k, i))
        return r

    for i in range(n):
      a, b = map(int, sys.stdin.readline().split())
      rate[i] = a 
      entry(i, b-1)
    for _ in range(q):
      c, d = map(int, sys.stdin.readline().split())
      transfer(c-1, d-1)
      print(inquire())
    
  def F(): pass 


class ABC171():
  def A():
    c = sys.stdin.readline().rstrip()
    print('A' if c < 'a' else 'a')

  def B():
    n, k, *p = map(int, sys.stdin.read().split())
    print(sum(sorted(p)[:k]))

  def C():
    n = int(sys.stdin.readline().rstrip())
    n -= 1
    l = 1
    while True:
      if n < pow(26, l):
        break 
      n -= pow(26, l)
      l += 1
    res = ''.join([chr(ord('a')+d%26) for d in NumberTheory.base_convert(n, 26)][::-1])
    res = 'a'*(l-len(res)) + res
    print(res)

  def D():
    n = int(sys.stdin.readline().rstrip())
    a = [int(x) for x in sys.stdin.readline().split()]
    s = sum(a)
    cnt = Counter(a)
    q = int(sys.stdin.readline().rstrip())
    for _ in range(q):
      b, c = map(int, sys.stdin.readline().split())
      s += (c-b)*cnt[b]
      print(s)
      cnt[c] += cnt[b]; cnt[b] = 0

  def E():
    n, *a = map(int, sys.stdin.read().split())
    s = 0
    for x in a: s ^= x 
    b = map(lambda x: x^s, a)
    print(*b, sep=' ')
    
  def F(): pass 

if __name__ == '__main__':
  ABC171.E()

Solution (Python):
N=int(input())
array=[int(x) for x in input().split()]
answer=0
for i in array:
	answer=answer^i
tobeprinted=[answer^i for i in array]
print(*tobeprinted)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
s = 0
for i in a:
	s ^= i
for i in a:
	print(s^i,end = ' ')

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
A=0
for i in range(N):
    A=A^a[i]
for i in range(N):
    print(A^a[i],end=' ')

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
x = 0
for i in a:
    x ^= i
for i in range(n):
    a[i] ^= x
print(*a)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = []
a_xor = a[0]^a[1]

for i in range(2,n):
    a_xor = a_xor ^ a[i]

for i in range(n):
    print(a_xor^a[i], end=' ')

print()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

al = 0
for x in a:
    al^=x
ans = [0]*n

for i in range(n):
    ans[i] = al^a[i]

print(" ".join([str(d) for d in ans]))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

t=0
for i in a:
  t = t ^ i
ans = []
for i in a:
  ans.append(t ^ i)
print(" ".join(str(i) for i in ans))

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
total = 0
for a in A:
    total ^= a

ans = ""

for a in A:
    ans += str(total^a) + " "

print(ans)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
a_sum = 0
for i in A:
    a_sum ^= i
for i in range(n):
    A[i] ^= a_sum
print(*A)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
  ans = ans ^ a[i]
for i in range(n):
  print(ans ^ a[i],end=" ")

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

all = 0

for i in range(N):
  all ^= a[i]
for i in range(N):
  print(all^a[i],end = " ")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

x = 0
for ai in a:
    x ^= ai

for ai in a:
    print(x ^ ai, end=' ')

Solution (Python):
n=int(input())
a = list(map(int,input().split()))
t = 0
for aa in a:
  t = t ^ aa

r = []
for aa in a:
  r.append(t ^ aa)
print(*r, sep=' ')

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

xor_a = 0
for i in range(n):
  xor_a ^= a[i]



ans = []
for i in range(n):
  ans.append(a[i] ^ xor_a)

print(*ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

s = 0
for i in range(n):
    s ^= a[i]
print(' '.join([str(i^s) for i in a]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
S = 0
for a in A:
    S ^= a
print(" ".join([str(S ^ a) for a in A]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
maxl = len(bin(max(A))[2:])
ans = [['0'] * N for _ in range(maxl)]
for n in range(N):
    for d, a in enumerate(bin(A[n])[2:].zfill(maxl)):
        ans[d][n] = a

for dn in range(maxl):
    n1 = sum([1 for d in ans[dn] if d == '1'])
    if n1 % 2 == 1:
        for n in range(N):
            ans[dn][n] = '0' if ans[dn][n] == '1' else '1'

prt = [int(''.join([ans[d][n] for d in range(maxl)]), 2) for n in range(N)]
print(' '.join(map(str, prt)))

Solution (Python):
def main():
    n = int(input())
    a = list(map(int,input().split()))
    b = a[0] ^ a[1]
    for i in range(2,n):
        b = b ^ a[i]
    ans = []
    for i in range(n):
        ans.append(b ^ a[i])
    ans = list(map(str,ans))
    print(' '.join(ans))

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
arr=list(map(int,input().split()))
xors = 0
for val in arr: 
 xors^=val 
ans=[]
for i in range(n): 
 ans.append(xors^arr[i])
print(*ans)

Solution (Python):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd

n = ni()
A = list(ma())
tot = 0
for a in A:
    tot = tot^a
ans = []
for a in A:
    ans.append(tot^a)
print(*ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))


s = a[0]
for num in a[1:]:
    s ^= num


res = [0] * n
for i, num in enumerate(a):
    res[i] = s ^ num

print(*res)

Solution (Python):
from functools import reduce

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

s = int(reduce(lambda i,j: i^j, a))
print(' '.join(list(map(lambda x: str(x^s), a))))

Solution (Python):
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


"""def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)"""

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


def main():
    n=int(input())
    ar=inpt()
    xor=0
    for i in ar:
        xor^=i
    for i in ar:
        print(xor^i,end=' ')















BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
arr = list(map(int,input().split()))
xor = 0
for i in arr:
	xor ^= i
for i in arr:
	print(i^xor,end = ' ')

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[]
s=0
for aa in a:
  s^=aa
for aa in a:
  b.append(s^aa)
print(*b)

Solution (Python):
N=int(input())
a = list(map(int,input().split()))
s = a[0]
for i in range(1,len(a)):
    s ^= a[i]
    

for i in range(len(a)):
    
    ans = s^a[i]
    print(ans,end=" ")

Solution (Python):
n = int(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)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

m = max(a)
ans = [0] * n
z = 1
while True:
  b = False
  for i in range(n):
    if a[i] & z:
      b = not b
  for i in range(n):
    if not b:
      if a[i] & z:
        ans[i] |= z
    else:
      if not (a[i] & z):
        ans[i] |= z

  z <<= 1
  if z > m:
    break

print(' '.join([str(x) for x in ans]))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))



S = 0
for aa in a:
    S ^= aa


ans = []
for ai in a:
    ans.append(S ^ ai)

print(*ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
S = 0
for aa in a:
    S ^= aa
ans = ""
for ai in a:
    ans += f'{str(S ^ ai)} '
print(ans.rstrip())

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
S = 0
for aa in a:
    S ^= aa
ans = ""
for ai in a:
    ans += f'{str(S ^ ai)} '
print(ans.rstrip())

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

s = 0

for i in range(n):
    s ^= a[i]

for i in range(n):
    a[i] ^= s
    print(a[i], end=" ")

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
c=a[0]
for i in range(1,n):
  c=c^a[i]

for i in range(n):
  print(c^a[i])

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
s=0
for i in l:s^=i
for i in l:print(s^i,end=" ")

Solution (Python):
import numpy as np
import sys 

readline = sys.stdin.readline 

N = int(input())
A = np.array(readline().split(), np.int64)
all_xor = 0
for a in A:
    all_xor = all_xor^a

for a in A:
    xor = all_xor^a
    print(xor, end = ' ')

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

r1=0
for jj in range(n):
  r1=r1^a[jj]

r=[0]*n
for ii in range(n):
  r[ii]=r1^a[ii]
"""
for ii in range(n):
  print(bin(a[ii]),bin(r[ii]))
"""
print(*r)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
S = 0
for x in A:
    S ^= x
    
for i in range(len(A)):
    A[i] ^= S
    
print(*A)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    a = LI()

    s = 0
    for c in a:
        s ^= c

    rr = []
    for c in a:
        rr.append(s ^ c)


    return JA(rr, ' ')


print(main())

Solution (Python):
from functools import reduce
N = int(input())
A = [int(n) for n in input().split()]
X = reduce(int.__xor__, A)
ans = [X^a for a in A]
print(*ans)