def main():
    from collections import Counter
    from math import gcd, sqrt
    input()
    cnt = Counter(map(int, input().split()))
    kk, res = sorted(cnt.keys(), reverse=True), []
    for k in kk:
        if cnt[k]:
            c = Counter()
            for k0, v0 in res:
                q = gcd(k, k0)
                c[q] += v0
            b = c[k]
            v = int(sqrt(b * b + cnt[k])) - b
            res.append((k, v))
            for k0, v0 in c.items():
                cnt[k0] -= v0 * v * 2
    print(*sorted((k for k, v in res for _ in range(v))))


if __name__ == '__main__':
    main()
