#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  a %= b;
  return gcd(b, a);
}
int main() {
  int n;
  cin >> n;
  vector<int> v, ans;
  map<int, int> mapa;
  for (int i = 0; i < (n * n); i++) {
    int a;
    cin >> a;
    v.push_back(a);
    mapa[v[i]]++;
  }
  sort(v.begin(), v.end());
  int cont = 0;
  for (int i = (n * n) - 1; i >= 0; i--) {
    if (mapa[v[i]] > 0) {
      ans.push_back(v[i]);
      cont++;
      for (int j = 0; j < cont; j++) {
        mapa[gcd(v[i], ans[j])] -= 2;
      }
    }
  }
  for (int i = 0; i < cont; i++) cout << ans[i] << " ";
  return 0;
}
