#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
long long gcd(long long X, long long Y) {
  if (X < Y) swap(X, Y);
  long long tmp;
  while (X != 0) {
    tmp = X;
    X = Y % X;
    Y = tmp;
  }
  return Y;
}
int a[500 * 500 + 100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0, _n = n * n; i < _n; i++) scanf("%d", a + i);
  sort(a, a + n * n);
  vector<int> r;
  r.push_back(a[n * n - 1]);
  map<int, int> st;
  for (int i = 0, _n = n * n; i < _n; i++) {
    if (st.find(a[i]) != st.end())
      st[a[i]]++;
    else
      st[a[i]] = 1;
  }
  st[a[n * n - 1]]--;
  for (int i = n * n - 2; i >= 0; i--) {
    if (st[a[i]] <= 0) continue;
    for (int j = 0, _n = r.size(); j < _n; j++) {
      st[gcd(a[i], r[j])] -= 2;
    }
    r.push_back(a[i]);
    st[a[i]]--;
  }
  printf("%d", r[0]);
  for (int i = 1, _n = r.size(); i < _n; i++) printf(" %d", r[i]);
  printf("\n");
  return 0;
}
