#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
int a[500 * 500 + 10];
int gcd(int p, int q) {
  if (q == 0)
    return p;
  else
    return gcd(q, p % q);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    scanf("%d", &a[i]);
    ma[a[i]]++;
  }
  sort(a + 1, a + 1 + n * n);
  vector<int> v;
  for (int i = n * n; i >= 1; i--) {
    if (ma[a[i]] > 0) {
      ma[a[i]]--;
      int p = a[i];
      for (int j = 0; j < v.size(); j++) {
        int q = v[j];
        int k = gcd(p, q);
        ma[k] -= 2;
      }
      v.push_back(a[i]);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    printf("%d ", v[i]);
  }
  cout << endl;
  return 0;
}
