#include <bits/stdc++.h>
using namespace std;
unsigned int gcd(unsigned int a, unsigned int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
struct cmp {
  bool operator()(const unsigned int a, const unsigned int b) const {
    return a > b;
  }
};
int main() {
  map<unsigned int, int, cmp> m;
  map<unsigned int, int, cmp>::iterator it, it2;
  vector<int> ans;
  int n, curr, gcd_value, value;
  int max = 10;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> value;
    m[value]++;
  }
  for (it = m.begin(); it != m.end(); it++) {
    while (it->second) {
      curr = it->first;
      it->second--;
      ans.push_back(curr);
      for (int j = 0; j < (ans.size() - 1); j++) {
        m[gcd(ans[j], curr)] -= 2;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
