#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 * 500 + 10;
int vis[maxn], cnt[maxn], ax[maxn], rec[maxn];
map<int, int> ac;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
vector<int> ab;
int main() {
  int n, flag = 0;
  cin >> n;
  for (int i = 0; i < n * n; i++) scanf("%d", &ax[i]);
  if (n == 1) {
    cout << ax[0];
    return 0;
  }
  sort(ax, ax + n * n);
  int a = ax[n * n - 1], b = ax[n * n - 2];
  ab.push_back(a), ab.push_back(b);
  int m = gcd(a, b), j = 3;
  ac[m] += 2;
  while (ab.size() != n) {
    int t = ax[n * n - j];
    j++;
    if (ac[t]) {
      ac[t]--;
      continue;
    }
    for (int i = 0; i < ab.size(); i++) {
      int m = gcd(ab[i], t);
      ac[m] += 2;
    }
    ab.push_back(t);
  }
  for (int i = 0; i < ab.size(); i++) {
    if (i != 0) cout << " ";
    cout << ab[i];
  }
  return 0;
}
