#include <bits/stdc++.h>
using namespace std;
long long n, A[300100], ans[1100], ansl;
int main() {
  cin >> n;
  for (int __z = 0; __z < n * n; __z++) cin >> A[__z];
  ;
  sort(A, A + (n * n));
  reverse(A, A + (n * n));
  for (int i = 0; i < n * n;) {
    int cnt = 0;
    for (; A[i + cnt] == A[i]; cnt++)
      ;
    int mult = 0;
    for (int j = 0; j < ansl; j++)
      if ((ans[j] % A[i]) == 0) mult++;
    int rep;
    for (rep = 1; rep <= n - ansl; rep++) {
      if (2 * mult * (rep + 1) + (rep + 1) * (rep + 1) > cnt) break;
    }
    while (rep--) ans[ansl++] = A[i];
    i += cnt;
  }
  for (int __z = 0; __z < n; __z++) cout << ans[__z] << " ";
  ;
  cout << endl;
  return 0;
}
