#include <bits/stdc++.h>
using namespace std;
const int N = 507;
int n, a;
map<int, int> ile;
map<int, int, greater<int> > res;
int pierw[N * N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    pierw[i * i] = i;
  }
  for (int i = 1; i <= n * n; ++i) {
    cin >> a;
    ++ile[a];
    res[a] = 0;
  }
  for (auto it1 : ile) {
    for (auto it2 : ile) {
      if (it2.first > it1.first && it2.first % it1.first == 0)
        ile[it1.first] += ile[it2.first];
    }
  }
  for (auto it1 : res) {
    res[it1.first] = pierw[ile[it1.first]];
    for (auto it2 : res) {
      if (it2.first > it1.first && it2.first % it1.first == 0)
        res[it1.first] -= res[it2.first];
    }
  }
  for (auto it : res) {
    int curr = it.second;
    while (curr--) cout << it.first << " ";
  }
}
