#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ss second
#define ff first
#define pb push_back
#define pll pair<long long, long long>
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

ll dx[] = {1,-1,0,0};
ll dy[] = {0,0,1,-1};
const ll sz = 2e5+5, mod = 998244353;
ll t,n,m,k;

ll power(ll a,ll b)
{
    ll ans=1;
    while(b>0)
    {
        if(b&1)
        {
            ans=(ans*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return ans;

}
ll Inv(ll a)
{
    return power(a,mod-2);
}

int main()
{
    FIO
    t  = 1;
    //cin>>t;
    while(t--)
    {
        cin>>n;
        map<ll,ll> mp;
        set<ll,greater<ll>> Set;
        for(int i=0;i<n*n;i++)
        {
            ll a;
            cin>>a;
            Set.insert(a);
            mp[a]++;
        }
        vector<pll> ans;
        while(!Set.empty())
        {
            ll val = *Set.begin();
            for(auto i:ans)
            {
                ll last = i.ff;
                ll fre = i.ss;
                ll del = __gcd(val,last);
                mp[del] -= 2*fre;
                if(mp[del] == 0)
                    Set.erase(del);
            }
            ll fre = mp[val];
            fre = sqrt(fre);
            ll last = val;
            ans.pb({last,fre});
            mp.erase(val);
            Set.erase(val);
        }
        for(auto i:ans)
        {
            for(int j=0;j<i.ss;j++)
                cout<<i.ff<<" ";
        }
        cout<<"\n";
    }
    return 0;
}
