import math as ma
# import sys
# input=sys.stdin.readline

def gcd(a,b):
    if a%b==0:
        return b
    else:
        return gcd(b,a%b)

n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
b={}
for i in range(n*n):
    if a[i] in b.keys():
        b[a[i]]+=1
    else:
        b[a[i]]=1
c=[]
for i in b:
    if b[i]%2!=0:
        c.append(i)
for i in b:
    if len(c)<n:
        if b[i]%2==0:
            c.append(i)
            c.append(i)
    else:
        break
print(*c)