#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
class Comp {
 public:
  bool operator()(int a, int b) const { return a > b; }
};
int main() {
  int n;
  cin >> n;
  map<int, int, Comp> a;
  vector<int> ans;
  for (int i{0}; i < n * n; i++) {
    int t;
    scanf("%d", &t);
    a[t]++;
  }
  while (!a.empty()) {
    map<int, int>::iterator it = a.begin();
    cout << it->first << " ";
    for (int x : ans) {
      int g = gcd(it->first, x);
      a[g] -= 2;
      if (!a[g]) a.erase(g);
    }
    ans.push_back(it->first);
    it->second--;
    if (!it->second) a.erase(it);
  }
}
