#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int, greater<int> > g;
int a;
int gcd(int a, int b) {
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (int(i) = (0); (i) < int(n * n); ++(i)) {
    cin >> a;
    g[a]++;
  }
  vector<int> ans;
  while (1) {
    bool done = 0;
    for (auto& x : g) {
      if (x.second <= 0) continue;
      x.second--;
      done = 1;
      for (auto every : ans) {
        g[gcd(every, x.first)] -= 2;
      }
      ans.push_back(x.first);
      g[x.first]--;
      break;
    }
    if (!done) break;
  }
  for (auto y : ans) cout << y << " ";
  cin.sync();
  cin.get();
  return 0;
}
