#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
map<int, int> vis;
int num[620 * 620], n;
int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); }
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n * n; i++) {
      scanf("%d", &num[i]);
      vis[num[i]] += 1;
    }
    if (n == 1) {
      printf("%d\n", num[1]);
      continue;
    }
    sort(num + 1, num + n * n + 1);
    for (int i = n * n; i; i--) {
      if (!vis[num[i]]) continue;
      vis[num[i]]--;
      for (int j = 0; j < ans.size(); j++) {
        vis[gcd(ans[j], num[i])] -= 2;
      }
      ans.push_back(num[i]);
    }
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
