#include <bits/stdc++.h>
using namespace std;
int a[250005], b[505], z[505][505], q[250005];
int gcd(int m, int n) {
  if (m == 0) return n;
  if (n == 0) return m;
  return gcd(n, m % n);
}
int find(int x, int l, int r) {
  if (l == r) return l;
  if (l == r - 1) {
    if (a[l] == x && q[l] == 0) return l;
    return r;
  }
  int mi = (l + r) / 2;
  if (a[mi] == x && q[mi] == 0)
    return find(x, l, mi);
  else if (a[mi] <= x)
    return find(x, mi + 1, r);
  return find(x, l, mi - 1);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) cin >> a[i];
  sort(a, a + n * n);
  b[n - 1] = a[n * n - 1];
  b[n - 2] = a[n * n - 2];
  if (n > 1) {
    q[find(gcd(b[n - 1], b[n - 2]), 0, n * n - 3)] = 1;
    q[find(gcd(b[n - 1], b[n - 2]), 0, n * n - 3)] = 1;
  }
  int abtak = n - 2;
  for (int i = n * n - 3; i >= 0 && abtak != 0; i--) {
    if (q[i] == 0) {
      abtak--;
      b[abtak] = a[i];
      for (int j = abtak + 1; j < n; j++) {
        q[find(gcd(a[i], b[j]), 0, i - 1)] = 1;
        q[find(gcd(a[i], b[j]), 0, i - 1)] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << b[i] << " ";
  cout << endl;
  return 0;
}
