#include <bits/stdc++.h>
using namespace std;
int a[500 + 5];
map<int, int> m;
priority_queue<int> pq;
vector<int> res;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  int n, i, j, ans = 0;
  cin >> n;
  for (i = 0; i < n * n; i++) {
    cin >> a[i];
    pq.push(a[i]);
    m[a[i]]++;
  }
  int p = pq.top();
  while (ans < n) {
    int maxi = pq.top();
    pq.pop();
    if (!m[maxi]) {
      p = maxi;
      continue;
    }
    m[maxi]--;
    res.push_back(maxi);
    if (maxi != p) m[gcd(maxi, p)] -= 2;
    ans++;
    p = maxi;
  }
  for (i = 0; i < (int)res.size(); i++) cout << res[i] << " ";
  return 0;
}
