#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &stream, const vector<T> &data) {
  for (auto i : data) {
    stream << i << ' ';
  }
  return stream;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  vector<int> in(n * n), data(n * n), counts(n * n, 0);
  for (int i = 0; i < (n * n); ++i) {
    cin >> in[i];
  }
  sort(in.begin(), in.end(), std::greater<int>());
  map<int, int> all;
  data[0] = in[0];
  counts[0] = 1;
  for (int i = 1, j = 0; i < in.size(); ++i) {
    if (in[i] != in[i - 1]) {
      ++j;
      data[j] = in[i];
    }
    ++counts[j];
  }
  for (int i = 0; i < n * n; ++i) {
    all[data[i]] = counts[i];
  }
  vector<int> result;
  for (int i = 0; i < n; ++i) {
    int cur = all.rbegin()->first;
    for (int j = 0; j < result.size(); ++j) {
      int k = gcd(cur, result[j]);
      all[k] -= 2;
      if (all[k] == 0) {
        all.erase(k);
      }
    }
    all[cur] -= 1;
    if (all[cur] == 0) {
      all.erase(cur);
    }
    result.push_back(cur);
  }
  cout << result << endl;
  return 0;
}
