#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
const int INF = 1000000000;
const int MAX = 700;
const int CNT = 20;
const int MAX2 = 200000;
const int BASE = 1000000000;
int n, a[1000000];
vector<int> ans;
set<pair<int, int> > Q;
int nsd(int a, int b) {
  if (!a || !b) return a + b;
  return nsd(b % a, a);
}
int main() {
  cin >> n;
  n *= n;
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
    Q.insert(make_pair(-a[i], i));
  }
  while (Q.size()) {
    int v = -Q.begin()->first;
    ans.push_back(v);
    for (int i = (0); i < (ans.size()); ++i) {
      Q.erase(Q.upper_bound(make_pair(-nsd(ans[i], v), -1)));
      if (i != ans.size() - 1)
        Q.erase(Q.upper_bound(make_pair(-nsd(ans[i], v), -1)));
    }
  }
  for (int i = (0); i < (ans.size()); ++i) cout << ans[i] << " ";
  return 0;
}
