#include <bits/stdc++.h>
using namespace std;
bool trace = false;
int nod(int a, int b) {
  if (a < b) swap(a, b);
  while (a % b != 0) {
    int c = a % b;
    a = b;
    b = c;
  }
  return b;
}
int main(int argc) {
  if (argc > 1) trace = true;
  int n;
  cin >> n;
  vector<int> v;
  for (size_t i = 0; i < n * n; ++i) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  vector<int> ans;
  sort(v.begin(), v.end());
  vector<int> uniques;
  vector<int> limits;
  vector<int> used;
  for (size_t i = 0; i < n * n; ++i) {
    if (i == 0 || v[i] != v[i - 1]) {
      uniques.push_back(v[i]);
      limits.push_back(1);
    } else
      limits.back()++;
  }
  used.assign(uniques.size(), 0);
  while (ans.size() < n) {
    while (used.back() == limits.back()) {
      used.pop_back();
      limits.pop_back();
      uniques.pop_back();
    }
    int newV = uniques.back();
    used.back()++;
    for (size_t i = 0; i < ans.size(); ++i) {
      int nd = nod(newV, ans[i]);
      vector<int>::iterator it =
          lower_bound(uniques.begin(), uniques.end(), nd);
      used[it - uniques.begin()] += 2;
    }
    ans.push_back(newV);
  }
  for (size_t i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
