#include <bits/stdc++.h>
using namespace std;
int n, m, r = 2;
int a[250005], ok[250005];
map<int, int> p;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
void nhap() {
  cin >> n;
  if (n == 1) {
    cin >> a[1];
    cout << a[1];
    exit(0);
  }
  m = n;
  n *= n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1, greater<int>());
  cout << a[1] << " " << a[2] << " ";
  ok[1] = a[1];
  ok[2] = a[2];
  p.clear();
  p[gcd(a[1], a[2])] = 2;
}
void xuly() {
  for (int i = 3; i <= n; i++) {
    if (r == m) break;
    if (p[a[i]]) {
      p[a[i]]--;
      continue;
    }
    cout << a[i] << " ";
    ok[++r] = a[i];
    for (int i = 1; i <= r - 1; i++) p[gcd(ok[i], ok[r])] += 2;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  nhap();
  xuly();
  return 0;
}
