import sys

input = sys.stdin.readline

from itertools import accumulate

from functools import reduce

from operator import xor, add





def read():

    N = int(input().strip())

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

    return N, A





def solve(N, A):

    L = list(accumulate(A, xor))

    R = list(accumulate(A[::-1], xor))[::-1]

    ans = [0 for i in range(N)]

    for i in range(N):

        a = 0

        l = L[i-1] if i > 0 else 0

        a ^= l

        r = R[i+1] if i+1 < N else 0

        a ^= r

        ans[i] = a

    print((*ans))





if __name__ == '__main__':

    inputs = read()

    outputs = solve(*inputs)

    if outputs is not None:

        print(("%s" % str(outputs)))

import sys

input = sys.stdin.readline

from itertools import accumulate

from functools import reduce

from operator import xor, add





def read():

    N = int(input().strip())

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

    return N, A





def solve(N, A):

    S = reduce(xor, A)

    for a in A:

        print(S ^ a, end=" ")





if __name__ == '__main__':

    inputs = read()

    outputs = solve(*inputs)

    if outputs is not None:

        print("%s" % str(outputs))

import sys

input = sys.stdin.readline
from itertools import accumulate
from functools import reduce
from operator import xor, add


def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A):
    L = list(accumulate(A, xor))
    R = list(accumulate(A[::-1], xor))[::-1]
    ans = [0 for i in range(N)]
    for i in range(N):
        a = 0
        l = L[i - 1] if i > 0 else 0
        a ^= l
        r = R[i + 1] if i + 1 < N else 0
        a ^= r
        ans[i] = a
    print((*ans))


if __name__ == "__main__":
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print(("%s" % str(outputs)))

import sys

input = sys.stdin.readline
from itertools import accumulate
from functools import reduce
from operator import xor, add


def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A):
    S = reduce(xor, A)
    for a in A:
        print(S ^ a, end=" ")


if __name__ == "__main__":
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

-    L = list(accumulate(A, xor)) -    R = list(accumulate(A[::-1], xor))[::-1] -    ans = [0 for i in range(N)] -    for i in range(N): -        a = 0 -        l = L[i - 1] if i > 0 else 0 -        a ^= l -        r = R[i + 1] if i + 1 < N else 0 -        a ^= r -        ans[i] = a -    print((*ans)) +    S = reduce(xor, A) +    for a in A: +        print(S ^ a, end=" ") -        print(("%s" % str(outputs))) +        print("%s" % str(outputs))