#include <bits/stdc++.h>
using namespace std;
int GCD(int x, int y) {
  if (y == 0) return x;
  return GCD(y, x % y);
}
map<int, int> m;
vector<int> r;
int main() {
  ios_base::sync_with_stdio(false);
  map<int, int>::iterator it;
  int i, n, x, g;
  cin >> n;
  n *= n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    m[x] = m[x] + 1;
  }
  n = sqrt(n);
  it = m.end();
  it--;
  r.push_back(it->first);
  m[it->first] = m[it->first] - 1;
  if (n != 1)
    while (!m[it->first]) it--;
  while (r.size() < n) {
    while (!m[it->first]) it--;
    r.push_back(it->first);
    m[it->first] = m[it->first] - 1;
    for (i = 0; i < r.size() - 1; i++) {
      g = GCD(r[i], it->first);
      m[g] = m[g] - 2;
    }
  }
  for (i = 0; i < r.size(); i++) cout << r[i] << ' ';
  cout << endl;
  return 0;
}
