#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  int m = 1;
  while (m > 0) {
    solve();
    m--;
  }
  return 0;
}
int NOD(int a, int b) {
  if (a < b) {
    return NOD(b, a);
  }
  if (a % b == 0) return b;
  return NOD(b, a % b);
}
void solve() {
  int n;
  cin >> n;
  vector<int> ans;
  map<int, int> b;
  for (int i = 0; i < n * n; i++) {
    int r;
    cin >> r;
    b[-r]++;
  }
  int asdf = 0;
  for (map<int, int>::iterator iter = b.begin(); iter != b.end(); ++iter) {
    int cur = -iter->first;
    int kol = iter->second;
    if (kol == 0) continue;
    int m = 0;
    for (int i = 0; i < ans.size(); i++) {
      if (ans[i] % cur == 0) {
        m++;
      }
    }
    int t = 1;
    while (t * t + 2 * m * t < kol) t++;
    for (int i = 0; i < t; i++) {
      ans.push_back(cur);
    }
    for (int i = 0; i < ans.size() - t; i++) {
      int upd = NOD(ans[i], cur);
      b[-upd] -= 2 * t;
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << ' ';
  }
  return;
}
