#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int maxn = 1005;
long long a[300000];
priority_queue<long long> ql;
map<long long, long long> ma;
map<long long, long long> num;
vector<long long> ans;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    cin >> a[i];
    ql.push(a[i]);
  }
  while (!ql.empty()) {
    long long z = ql.top();
    ql.pop();
    if (ma[z] != 0) {
      ma[z]--;
      continue;
    } else {
      for (int i = 0; i < ans.size(); i++) {
        ma[gcd(ans[i], z)] += 2;
      }
      ans.push_back(z);
      continue;
    }
  }
  for (int i = 0; i < ans.size() - 1; i++) cout << ans[i] << " ";
  cout << ans[ans.size() - 1] << endl;
  return 0;
}
