def main():

    import sys

    read = sys.stdin.buffer.read

    readline = sys.stdin.buffer.readline

    readlines = sys.stdin.buffer.readlines

    sys.setrecursionlimit(10 ** 7)



    n = int(readline())

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

    ans = [0] * n

    v = 2 ** 30

    for i in range(30):

        v //= 2

        check = [False] * n

        cnt = 0

        for j, aa in enumerate(a):

            if aa >= v:

                a[j] -= v

                check[j] = True

                cnt += 1

        if cnt % 2 == 1:

            for j, c in enumerate(check):

                if not c:

                    ans[j] += v

        else:

            for j, c in enumerate(check):

                if c:

                    ans[j] += v

    print((*ans))





if __name__ == '__main__':

    main()

def main():

    import sys

    read = sys.stdin.buffer.read

    readline = sys.stdin.buffer.readline

    readlines = sys.stdin.buffer.readlines

    sys.setrecursionlimit(10 ** 7)



    n = int(readline())

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

    memo = 0

    for aa in a:

        memo ^= aa

    for i in range(n):

        a[i] ^= memo

    print((*a))





if __name__ == '__main__':

    main()

def main():
    import sys

    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10**7)
    n = int(readline())
    a = list(map(int, readline().split()))
    ans = [0] * n
    v = 2**30
    for i in range(30):
        v //= 2
        check = [False] * n
        cnt = 0
        for j, aa in enumerate(a):
            if aa >= v:
                a[j] -= v
                check[j] = True
                cnt += 1
        if cnt % 2 == 1:
            for j, c in enumerate(check):
                if not c:
                    ans[j] += v
        else:
            for j, c in enumerate(check):
                if c:
                    ans[j] += v
    print((*ans))


if __name__ == "__main__":
    main()

def main():
    import sys

    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10**7)
    n = int(readline())
    a = list(map(int, readline().split()))
    memo = 0
    for aa in a:
        memo ^= aa
    for i in range(n):
        a[i] ^= memo
    print((*a))


if __name__ == "__main__":
    main()

-    ans = [0] * n -    v = 2**30 -    for i in range(30): -        v //= 2 -        check = [False] * n -        cnt = 0 -        for j, aa in enumerate(a): -            if aa >= v: -                a[j] -= v -                check[j] = True -                cnt += 1 -        if cnt % 2 == 1: -            for j, c in enumerate(check): -                if not c: -                    ans[j] += v -        else: -            for j, c in enumerate(check): -                if c: -                    ans[j] += v -    print((*ans)) +    memo = 0 +    for aa in a: +        memo ^= aa +    for i in range(n): +        a[i] ^= memo +    print((*a))