#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = 1LL * INF * INF;
const long long mod = INF + 7;
const double eps = 1e-12;
const int maxN = 1000 * 100;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
class solver {
 public:
  int n;
  map<int, int> g;
  vector<int> ans;
  void input() { scanf("%d", &n); }
  void solve() {
    int tmp;
    for (int i = 0; i < n * n; ++i) {
      scanf("%d", &tmp);
      g[tmp]++;
    }
    for (auto it : g) {
      if ((it.second % 2) == 1) {
        ans.push_back(it.first);
      }
    }
    for (auto it : ans)
      for (auto it2 : ans) g[gcd(it, it2)]--;
    for (auto it = g.rbegin(); it != g.rend(); ++it) {
      while (it->second > 0) {
        ans.push_back(it->first);
        for (int i = 0; i < ans.size(); ++i) {
          g[gcd(it->first, ans[i])] -= 2;
        }
      }
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << " ";
    cout << endl;
  }
};
int main() {
  solver s;
  s.input();
  s.solve();
  return 0;
}
