import fractions

N = int(raw_input())

NN = sorted([int(x) for x in raw_input().split()], reverse=True)

skip = {}

res = []

for n in NN:
    if skip.setdefault(n, 0) > 0:
        skip[n] = skip[n] - 1
        continue

    for m in res:
        g = fractions.gcd(m, n)
        skip[g] = skip.setdefault(g, 0) + 2

    res.append(n)

print ' '.join([str(x) for x in res])
