#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 3e5 + 5;
multiset<int> s;
vector<int> ret;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    s.insert(x);
  }
  multiset<int>::iterator it;
  while (ret.size() < n) {
    int x = *s.rbegin();
    it = s.find(x);
    s.erase(it);
    for (int i = 0; i < ret.size(); i++) {
      it = s.find(gcd(x, ret[i]));
      s.erase(it);
      it = s.find(gcd(x, ret[i]));
      s.erase(it);
    }
    ret.push_back(x);
  }
  for (int i = 0; i < n; i++) cout << ret[i] << " ";
  return 0;
}
