import copy

def main():



    N = int(eval(input()))

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

    AD = copy.copy(A)

    AAA = []



    while len(AD) > 1:

        if len(AD)%2==1:

            AD.append(0)

        for i in range(0,len(AD),2):

            AAA.append(AD[i]^AD[i+1])

        AD = copy.copy(AAA)

        AAA.clear()

    

    for i in range(N):

        A[i] = AD[0] ^ A[i]

    

    print((*A))











if __name__ == '__main__':

    main()
def main():



    N = int(eval(input()))

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

    su = 0



    for i in range(N):

        su = su ^ A[i]





    

    for i in range(N):

        A[i] = su ^ A[i]

    

    print((*A))



if __name__ == '__main__':

    main()
import copy


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    AD = copy.copy(A)
    AAA = []
    while len(AD) > 1:
        if len(AD) % 2 == 1:
            AD.append(0)
        for i in range(0, len(AD), 2):
            AAA.append(AD[i] ^ AD[i + 1])
        AD = copy.copy(AAA)
        AAA.clear()
    for i in range(N):
        A[i] = AD[0] ^ A[i]
    print((*A))


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    su = 0
    for i in range(N):
        su = su ^ A[i]
    for i in range(N):
        A[i] = su ^ A[i]
    print((*A))


if __name__ == "__main__":
    main()

-import copy - - -    AD = copy.copy(A) -    AAA = [] -    while len(AD) > 1: -        if len(AD) % 2 == 1: -            AD.append(0) -        for i in range(0, len(AD), 2): -            AAA.append(AD[i] ^ AD[i + 1]) -        AD = copy.copy(AAA) -        AAA.clear() +    su = 0 -        A[i] = AD[0] ^ A[i] +        su = su ^ A[i] +    for i in range(N): +        A[i] = su ^ A[i]