#include <bits/stdc++.h>
using namespace std;
int GCD(int p, int q) {
  if (!p) return q;
  int temp;
  while (q != 0) {
    temp = q;
    q = p % q;
    p = temp;
  }
  return p;
}
map<int, int> m;
vector<int> r;
int main() {
  map<int, int>::iterator it;
  int i, n, x, g;
  cin >> n;
  for (i = 1; i <= n * n; i++) {
    cin >> x;
    m[x] = m[x] + 1;
  }
  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;
}
