#include <bits/stdc++.h>
using namespace std;
int const MAX_N = 300100;
int const INT_INF = 1010000000;
long long const LL_INF = 1000000000000000009LL;
int s[MAX_N];
map<int, int> ms;
vector<int> ans;
int real_cnt[MAX_N];
int gcd(int a, int b) {
  while (a && b) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return a + b;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) scanf("%d", &s[i]);
  sort(s, s + n * n);
  if (n == 1) {
    cout << s[0];
    return 0;
  }
  int k = 0;
  do {
    int bg = k;
    while (k + 1 < n * n && s[k] == s[k + 1]) k++;
    int en = k;
    k++;
    for (int i = bg; i <= en; i++) real_cnt[i] = en - bg + 1;
  } while (k < n * n);
  int j = n * n - 1;
  ans.push_back(s[j]);
  ans.push_back(s[j - 1]);
  j -= 2;
  ms[ans[0]]++;
  ms[ans[1]]++;
  ms[gcd(ans[0], ans[1])] += 2;
  while (j >= 0) {
    if (ms[s[j]] < real_cnt[j]) {
      ms[s[j]]++;
      for (int k = 0; k < (int)ans.size(); k++) ms[gcd(ans[k], s[j])] += 2;
      ans.push_back(s[j]);
    }
    j--;
    if ((int)ans.size() >= n) break;
  }
  for (int i = 0; i < (int)ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
