#include <bits/stdc++.h>
int gcd(int a, int b) {
  while (a > 0 && b > 0) {
    if (a > b) {
      a %= b;
    } else {
      b %= a;
    }
  }
  if (a == 0) return b;
  return a;
}
int main() {
  int n;
  scanf("%d", &n);
  std::map<int, int> mp;
  for (int i = 0; i < n * n; i++) {
    int a;
    scanf("%d", &a);
    mp[a]++;
  }
  std::vector<int> ans;
  while (!mp.empty()) {
    std::map<int, int>::iterator it = mp.end();
    it--;
    int smm = 0;
    while (it->second > 0) {
      for (int j = 0; j < (int)ans.size(); j++) {
        int gd = gcd(it->first, ans[j]);
        mp[gd] -= 2;
      }
      mp[it->first]--;
      ans.push_back(it->first);
    }
    mp.erase(it);
  }
  for (int i = 0; i < (int)ans.size(); i++) {
    printf("%d ", ans[i]);
  }
}
