#include <bits/stdc++.h>
using namespace std;
int n;
set<int> s;
map<int, int> mp;
vector<int> v;
int gcd(int x, int y) {
  if (x < y) {
    return gcd(y, x);
  }
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    int x;
    scanf("%d", &x);
    if (mp[x] == 0) s.insert(0 - x);
    mp[x]++;
  }
  v.clear();
  while (s.size()) {
    int k = *s.begin();
    k = 0 - k;
    mp[k]--;
    if (mp[k] == 0) {
      s.erase(0 - k);
    }
    for (int i = 0; i < v.size(); i++) {
      int l = gcd(v[i], k);
      mp[l] -= 2;
      if (mp[l] == 0) s.erase(0 - l);
    }
    v.push_back(k);
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
  return 0;
}
