import sys

n = input()
l = raw_input().split()
a = [int(i) for i in l]

d = {}

for i in a:
    if d.has_key(i):
        d[i]+=1
    else:
        d[i]=1
ans = ""
count = 0
for i in d.keys():
    if d[i]%2==1:
        count+=1
        ans+=str(i) + ' '
for i in xrange(n-count):
    ans+='1 '
print ans
