def gcd(a,b):
    while b: a,b=b,a%b
    return a

n = input()
a = sorted(map(int, raw_input().split()))
c = {}
for x in a:
    c[x] = c.get(x,0)+1

ans=[]
for x in sorted(c.keys())[::-1]:
    while c[x]:
        for y in ans: c[gcd(x,y)] -= 2
        ans += [x]
        c[x] -= 1
print (' '.join(map(str,ans)))
