from operator import xor
from functools import reduce
import sys

def answer(result):
    print(*result)

def search(this, hats, result):
    if len(hats) == 1:
        # print('saigo!')
        if this ^ hats[0] == result[0]:
            answer([*result, hats[0]])
            sys.exit()
        else:
            return

    for i in range(len(hats)):
        if this ^ hats[i] in hats:
            copy_hats = hats[:]
            copy_result = result[:]
            copy_result.append(copy_hats.pop(i))
            # print('next!', copy_result)
            search(copy_result[-1], copy_hats, copy_result)
        else:
            # print('dame')
            return


n = input()
hats = list(map(int, input().split(' ')))
result = []

if reduce(xor, hats) == 0:
    result.append(hats.pop())
    # print(result)
    search(result[0], hats, result)
else:
    print('No')