#include <bits/stdc++.h>
using namespace std;
int a[500 * 500 + 5];
map<int, int> m;
vector<int> pq;
vector<int> res;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, i, j;
  cin >> n;
  for (i = 0; i < n * n; i++) {
    cin >> a[i];
    pq.push_back(a[i]);
    m[a[i]]++;
  }
  sort(pq.begin(), pq.end());
  reverse(pq.begin(), pq.end());
  for (i = 0; i < n * n; i++) {
    int maxi = pq[i];
    if (m[maxi] <= 0) {
      continue;
    }
    m[maxi]--;
    for (j = 0; j < (int)res.size(); j++)
      if (maxi != res[j]) m[gcd(maxi, res[j])] -= 2;
    res.push_back(maxi);
  }
  for (i = 0; i < n; i++) cout << res[i] << " ";
  return 0;
}
