#include <bits/stdc++.h>
using namespace std;
map<long long int, int> m;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, i, k = 0, j;
  cin >> n;
  long long int ans[n + 2], x;
  vector<long long int> a;
  for (i = 0; i < n * n; i++) {
    cin >> x;
    a.push_back(x);
    m[a[i]]++;
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  vector<long long int>::iterator it;
  for (it = a.begin(); it != a.end(); it++) {
    if (m[*it] > 0) {
      for (j = 1; j <= k; j++) {
        long long int x = gcd(ans[j], *it);
        m[x] = m[x] - 2;
      }
      k++;
      ans[k] = *it;
      m[*it]--;
    }
  }
  for (i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
