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