import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
import math
def binarySearch(num,l,r,x):
    while l<=r:
        mid=(l+r)//2
        if num[mid]==x:
            return mid
        elif num[mid]<x:
            l=mid+1
        else:
            r=mid-1
def quadratic(b,c):
    e=pow(b,2)
    f=e-(4*c)
    d=math.sqrt(f)
    ans=(((-1)*b)+d)//2
    return ans
n=int(input())
arr=list(map(int,input().split()))
matrix=[[0]*n for i in range(n)]
a=max(arr)
dict1={}
for i in range(n**2):
    if arr[i] in dict1.keys():
        dict1[arr[i]]+=1
    else:
        dict1[arr[i]]=1
lis=[]
for i in dict1.keys():
    lis.append([i,dict1[i]])
lis.sort(key=lambda x:x[0],reverse=False)
num=[]
p=0
for i in lis:
    num.append(i[0])
    p+=1
a=math.sqrt(lis[-1][1])
ans=[[lis[-1][0],a]]
lis[-1][1]=0
i=p-2
k=1
while i>=0:
    if lis[i][1]>0:
        count=0
        for j in range(k):
            temp=math.gcd(ans[j][0],lis[i][0])
            if temp==lis[i][0]:
                count+=(ans[j][1]*2)
        if count==0:
            ans.append([lis[i][0],math.sqrt(lis[i][1])])
            lis[i][1]=0
        else:
            ans.append([lis[i][0],quadratic(count,(-1)*lis[i][1])])
            lis[i][1]=0
        for j in range(k):
            temp=math.gcd(ans[j][0],ans[-1][0])
            if temp!=ans[-1][0]:
                ind=binarySearch(num,0,p-1,temp)
                lis[ind][1]-=(2*ans[j][1]*ans[-1][1])
        k+=1
    i-=1
answer=[]
for i in ans:
    for j in range(int(i[1])):
        answer.append(i[0])
print(" ".join(str(x) for x in answer))