#include <bits/stdc++.h>
using namespace std;

int main(){

    int n; scanf("%d", &n);
    multiset<int, greater<int> > ms;
    for(int i = 1; i <= n*n; i++){
        int x; scanf("%d", &x);
        ms.insert(x);
    }

    if(n == 1){
        printf("%d\n", *ms.begin());
        return 0;
    }

    vector<int> res;
    res.push_back(*ms.begin()); ms.erase(ms.begin());
    res.push_back(*ms.begin()); ms.erase(ms.begin());

    ms.erase(__gcd(res[0], res[1]));
    ms.erase(__gcd(res[0], res[1]));

    while(res.size() < n and !ms.empty()){
        int x = *ms.begin(); ms.erase(ms.begin());
        for(int val : res){
            int y = __gcd(x, val);
            if(ms.find(y) != ms.end())
                ms.erase(ms.find(y));
            if(ms.find(y) != ms.end())
                ms.erase(ms.find(y));
        }
        res.push_back(x);
    }

    for(int val : res)
        printf("%d ", val);
    printf("\n");

    return 0;
}
