#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
int gcd(int a, int b) {
  while (b > 0) {
    auto r = a % b;
    a = b;
    b = r;
  }
  return a;
}
void solve() {
  int n;
  cin >> n;
  vector<int> b(n * n);
  map<int, int> m;
  for (int i = 0; i < n * n; ++i) {
    cin >> b[i];
    m[b[i]]++;
  }
  sort(begin(b), end(b));
  reverse(begin(b), end(b));
  vector<int> a;
  a.emplace_back(b[0]);
  m[b[0]]--;
  for (int i = 1; i < n * n && a.size() < n; ++i) {
    if (m[b[i]] == 0) continue;
    auto x = b[i];
    for (auto y : a) {
      m[gcd(x, y)] -= 2;
    }
    a.emplace_back(x);
    m[x]--;
  }
  sort(begin(a), end(a));
  for (auto x : a) cout << x << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
