#include <bits/stdc++.h>

#define ll long long
#define debug(x) cout<<#x<<": "<<x<<endl

using namespace std;

ll solve(ll coeff, ll cnt) {

  for(ll i = 1; i < 501; ++i) {
    if(i*i + i*coeff == cnt) {
      return i;
    }
  }

}

int main() {
  
  ll n;
  cin>>n;

  ll a[n*n];

  map<ll, ll> cnt;
  map<ll, ll> crrct;
  
  for(ll i = 0; i < n*n; ++i) {
    cin>>a[i];
    cnt[a[i]]++;
  }

  vector<ll> sol;

  auto it = cnt.end();
  --it;
  
  for(ll i = 0; i < it->second; ++i) {
    sol.push_back(it->first);
    if(sol.size() == n) {
      break;
    }
  }

  --it;

  while(sol.size() < n) {
    ll coeff = 0;
    for(auto a : sol) {
      if(a % it->first == 0) {
	coeff++;
      }
    }

    coeff *= 2;

    ll x = solve(coeff, it->second - 2*crrct[it->first]);
    //debug(it->first); debug(it->second); debug(crrct[it->first]); debug(x); cout<<endl; 

    ll start = sol.size() - 1;
    for(ll i = 0; i < x; ++i) {
      sol.push_back(it->first);
    }

    for(int i = start; i >= 0; --i) {
      if(__gcd(sol[i], it->first) != it->first) {
	crrct[__gcd(sol[i], it->first)] += x;
      }
    }

    --it;
  }

  for(auto a : sol) {
    cout<<a<<" ";
  }
  
  cout<<endl;
  
  return 0;
}
