#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long inf = 1ll << 61;
long long gcd(long long num1, long long num2) {
  if (num2 == 0) {
    return num1;
  }
  if (num1 < num2) {
    return gcd(num2, num1);
  }
  return gcd(num2, num1 % num2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, inp;
  cin >> n;
  set<long long, greater<long long> > mySet;
  map<long long, long long> mp;
  for (int i = 0; i < n * n; i++) {
    cin >> inp;
    mySet.insert(inp);
    mp[inp]++;
  }
  vector<long long> ans;
  map<long long, int> done;
  set<long long>::iterator it;
  for (it = mySet.begin(); it != mySet.end(); ++it) {
    while (mp[*it] > 0) {
      ans.push_back(*it);
      for (int i = 0; i < ans.size(); i++) {
        long long num = gcd(*it, ans[i]);
        if (i == ans.size() - 1) {
          mp[num]--;
        } else {
          mp[num] -= 2;
        }
      }
      if (ans.size() == n) {
        goto finish;
      }
    }
  }
finish:;
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
