#include <bits/stdc++.h>
using namespace std;
struct data_t {
  long long i, j, w;
  bool operator<(const data_t& right) const {
    return i == right.i ? j < right.j : i < right.i;
  }
};
int gcd(int i, int j) {
  if (i == j) return i;
  if (i < j) return gcd(j, i);
  if (j == 0) return i;
  return gcd(j, i % j);
}
int main() {
  int n;
  cin >> n;
  map<int, int> M;
  vector<int> as;
  for (int i = 0; i < n * n; ++i) {
    int a;
    cin >> a;
    as.push_back(a);
  }
  sort(as.begin(), as.end());
  reverse(as.begin(), as.end());
  vector<int> res;
  for (int i = 0; i < n * n; ++i) {
    int a = as[i];
    if (as[i + M[a]] == a) {
      res.push_back(a);
      for (int j = 0; j < res.size() - 1; ++j) {
        M[gcd(a, res[j])]++;
        M[gcd(a, res[j])]++;
      }
    }
    if (res.size() >= n) break;
  }
  for (int i = 0; i < n; ++i) cout << res[i] << " ";
  cout << endl;
  return 0;
}
