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

def fu(b):
    for i in b:
        if b[i]!=0:
            return i
    return -1

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:
    c.append(i)
    b[i]-=1
    break
while 1>0:
    if len(c)<n:
        a=fu(b)
        if a==-1:
            break
        else:
            b[a]-=1
            for i in range(len(c)):
                b[gcd(a,c[i])]-=2
            c.append(a)
    else:
        break

print(*c)