#include <bits/stdc++.h>
using namespace std;
int Nod(int a, int b) {
  if (a > b) a ^= b ^= a ^= b;
  return !a ? b : Nod(b % a, a);
}
void Solve() {
  int i, j, k, n, m;
  scanf("%d", &(n));
  map<int, int> mas;
  for (i = 0; i < n * n; i++) {
    int a;
    scanf("%d", &(a));
    mas[a]++;
  }
  vector<int> ans;
  for (auto it = mas.rbegin(); it != mas.rend(); it++) {
    while (it->second > 0) {
      if (it->second > 0) printf("%d ", it->first);
      int a = it->first;
      it->second--;
      for (i = 0; i < ans.size(); i++) {
        int o = Nod(a, ans[i]);
        mas[o] -= 2;
      }
      ans.push_back(a);
    }
  }
}
int main() {
  Solve();
  return 0;
}
