#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long lnf = 1e18 + 7;
const int maxn = 5e6 + 10;
long long mod = 1e9 + 7;
double eps = 1e-6;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
map<int, int> cnt;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n * n + 1);
  for (int i = 1; i <= n * n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  sort(a.begin() + 1, a.end());
  int tot = n * n;
  vector<int> ans;
  ans.push_back(a[tot]);
  cnt[a[tot]]--;
  for (int i = tot - 1; ans.size() < n && i >= 1; i--) {
    int flag = 1;
    if (cnt[a[i]] <= 0) continue;
    for (int j = 0; j < ans.size(); j++) {
      int g = gcd(a[i], ans[j]);
      if (cnt[g] <= 1) {
        flag = 0;
        for (int k = j - 1; k >= 0; k--) cnt[gcd(ans[k], a[i])] += 2;
        break;
      }
      cnt[g] -= 2;
    }
    if (flag) ans.push_back(a[i]), cnt[a[i]]--;
  }
  for (auto i : ans) cout << i << " ";
  return 0;
}
