#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int N, i, j;
  cin >> N;
  vector<int> G(N * N, 0);
  for (i = 0; i < N * N; i++) cin >> G[i];
  if (N == 1)
    cout << G[0] << endl;
  else {
    sort(G.begin(), G.end());
    unordered_map<int, int> cmap;
    for (i = 0; i < G.size(); i++) {
      if (cmap.find(G[i]) == cmap.end())
        cmap[G[i]] = 1;
      else
        cmap[G[i]]++;
    }
    vector<int> A(N, 0);
    int sz = 2;
    A[0] = G[G.size() - 1];
    A[1] = G[G.size() - 2];
    cmap[A[0]]--;
    cmap[A[1]]--;
    cmap[gcd(A[0], A[1])] -= 2;
    for (i = G.size() - 3; i >= 0; i--) {
      if (cmap[G[i]] > 0) {
        for (j = 0; j < sz; j++) {
          cmap[gcd(A[j], G[i])] -= 2;
        }
        A[sz] = G[i];
        cmap[A[sz]]--;
        ++sz;
        if (sz == N) break;
      }
    }
    for (i = 0; i < N; i++) cout << A[i] << " ";
    cout << endl;
  }
  return 0;
}
