def GCD(a,b):
    return a if b == 0 else GCD(b,a%b)
    
n = int(input())
g = list(map(int,input().split()))
g.sort()
c = {}
for i in range(n*n):
    if g[i] in c:
        c[g[i]] +=1 
    else:
        c[g[i]] = 1 
ans = []
for i in range(n*n-1,-1,-1):
    if c[g[i]] == 0 :
        continue
    c[g[i]] -= 1 
    for j in range(len(ans)):
        t = GCD(ans[j],g[i])
        c[t] -= 2 
    ans.append(g[i])
for value in ans:
    print(value,end=" ")
print()