#ifndef AZAD   
 #include<bits/stdc++.h>
  #define f(i,a,b) for(ll i=a;i<b;i++)
  #define fr(i,a,b) for(ll i=a;i>b;i--)  
  #define ll long long
  #define vll vector<ll>
  #define vv vector<vll>
  #define mll map<ll,ll>
  #define sll set<ll>
  #define pll pair<ll,ll>
  #define pb(x) push_back(x)
  #define F first
  #define S second
  #define print(v) for(auto it:v)cout<<it<<" ";cout<<endl;
  #define all(v) v.begin(),v.end()
  #define allr(v) v.rbegin(),v.rend()
  #define p4(x,y,z,w) cout<<"x="<<x<<" y="<<y<<" z="<<z<<" w="<<w<<endl
  #define p3(x,y,z) cout<<"x="<<x<<" y="<<y<<" z="<<z<<endl
  #define p2(x,y) cout<<"x="<<x<<" y="<<y<<endl
  #define p1(x) cout<<"x="<<x<<endl
  #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  #define InputOutput freopen("input.txt","r",stdin);//freopen("output.txt","w",stdout);
  const int mod = 1000000007;//10^9+7
  const ll INF=9000000000000000000;  // 9*10^18
 using namespace std; 
#endif

void solve(){
  ll n,cont=1,hold;
  cin>>n;
  vll ar(n*n);
  mll mp;
  f(i,0,n*n){
    cin>>ar[i];
    ar.pb(ar[i]);
    mp[ar[i]]++;
  } 
  sort(allr(ar)); 
  vll ans;
  ll cur=ar[0];
  ans.pb(cur);
  mp[cur]--;
  ll index=1;
  while(cont!=n){
    hold=ar[index];
    if(mp[hold]>0){
      mp[hold]--;
      ll gcd=__gcd(cur,hold);
      if(mp[gcd]>=2){
        ans.pb(hold);
        cont++;
        mp[gcd]-=2;
      }
      else mp[hold]++;
    }
    index++;
  }
  sort(allr(ans));
  print(ans);
}

int main(){
  #ifndef ONLINE_JUDGE 
    InputOutput
  #endif
  IOS  
  ll q=1;
  //cin>>q;
  while(q--){
    solve();
  }
  return 0;
} 