#include <bits/stdc++.h>
using namespace std;
map<long long, int> m;
vector<long long> ans(1000);
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  long long x;
  cin >> n;
  if (n == 1) {
    cin >> x;
    cout << x;
    return 0;
  }
  for (int i = 0; i < n * n; i++) {
    cin >> x;
    m[-x]++;
  }
  int pos = n - 1;
  for (auto it = m.begin(); it != m.end(); it++) {
    while (it->second) {
      ans[pos] = -it->first;
      it->second--;
      for (int i = pos + 1; i < n; i++) {
        m[-gcd(ans[pos], ans[i])] -= 2;
      }
      pos--;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
