#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int input[250000];
map<int, int, greater<int> > cnt;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n * n; ++i) {
    cin >> input[i];
  }
  for (int i = 0; i < n * n; ++i) {
    ++cnt[input[i]];
  }
  vector<int> ans(n);
  int pos = n - 1;
  for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
    while (it->second > 0) {
      --it->second;
      for (int j = pos + 1; j < n; ++j) {
        cnt[gcd(it->first, ans[j])] -= 2;
      }
      ans[pos--] = it->first;
    }
  }
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
