#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (!(a % b)) return b;
  return gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n * n);
  map<int, int> m;
  for (int i = 0; i < n * n; i++) {
    cin >> v[i];
    m[v[i]]++;
  }
  sort(v.rbegin(), v.rend());
  vector<int> e;
  for (int i = 0; i < n * n; i++) {
    if (m[v[i]] > 0) {
      cout << v[i] << " ";
      for (int k = 0; k < e.size(); k++) m[gcd(e[k], v[i])] -= 2;
      m[v[i]]--;
      e.push_back(v[i]);
    }
  }
}
