#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
void func() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  long long x = n * n, in;
  for (long long i = 0; i < x; i++) {
    cin >> in;
    mp[in]++;
  }
  vector<long long> ans;
  map<long long, long long>::iterator it = mp.end();
  while (it != mp.begin()) {
    it--;
    while ((it->second) > 0) {
      (it->second)--;
      for (auto j : ans) mp[gcd(it->first, j)] -= 2;
      ans.push_back(it->first);
    }
  }
  for (auto j : ans) cout << j << " ";
  ;
  cout << "\n";
}
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  long long ntc = 1;
  while (ntc) {
    func();
    ntc--;
  }
  return 0;
}
