#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int n, cnt, x, p, ans[550], a[250010];
int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n * n);
  for (int i = 1; i <= n * n; i++) mp[a[i]]++;
  p = n * n;
  while (cnt < n) {
    cnt++;
    while (mp[a[p]] == 0 && p > 0) p--;
    ans[cnt] = a[p];
    if (cnt == n) break;
    mp[a[p]]--;
    p--;
    while (mp[a[p]] == 0 && p > 0) p--;
    for (int i = 1; i <= cnt; i++) {
      int t = gcd(ans[i], a[p]);
      mp[t] -= 2;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
