from collections import deque

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N,*A = list(map(int, read().split()))

    

    L = [A[0]]

    R = deque([A[-1]])



    for i in range(1,N):

        L.append(L[-1] ^ A[i])

        R.appendleft(R[0] ^ A[-(i+1)])



    ans = [R[1]]

    for i in range(1,N-1):

        ans.append(L[i-1] ^ R[i+1])

    ans.append(L[-2])



    print((*ans))







if __name__ == "__main__":

    main()

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N,*A = list(map(int, read().split()))

    

    X = 0

    for a in A:

        X ^= a



    ans = []

    for a in A:

        ans.append(a ^ X)



    print((*ans))





if __name__ == "__main__":

    main()

from collections import deque
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N, *A = list(map(int, read().split()))
    L = [A[0]]
    R = deque([A[-1]])
    for i in range(1, N):
        L.append(L[-1] ^ A[i])
        R.appendleft(R[0] ^ A[-(i + 1)])
    ans = [R[1]]
    for i in range(1, N - 1):
        ans.append(L[i - 1] ^ R[i + 1])
    ans.append(L[-2])
    print((*ans))


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N, *A = list(map(int, read().split()))
    X = 0
    for a in A:
        X ^= a
    ans = []
    for a in A:
        ans.append(a ^ X)
    print((*ans))


if __name__ == "__main__":
    main()

-from collections import deque -    L = [A[0]] -    R = deque([A[-1]]) -    for i in range(1, N): -        L.append(L[-1] ^ A[i]) -        R.appendleft(R[0] ^ A[-(i + 1)]) -    ans = [R[1]] -    for i in range(1, N - 1): -        ans.append(L[i - 1] ^ R[i + 1]) -    ans.append(L[-2]) +    X = 0 +    for a in A: +        X ^= a +    ans = [] +    for a in A: +        ans.append(a ^ X)