def main():
    from collections import Counter
    from math import gcd, sqrt
    n = int(input())
    cnt = Counter(map(int, input().split()))
    kk = sorted(cnt.keys(), reverse=True)
    res = []
    for k in kk:
        c = Counter()
        for k0, v0 in res:
            q = gcd(k, k0)
            c[q] += v0
        b = c[k]
        del 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()
