#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
long long n;
map<long long, int> m;
long long ans[1000000], counter;
set<long long> s;
long long gcd(long long x, long long y) {
  while (x != 0 && y != 0)
    if (x > y)
      x = x % y;
    else
      y = y % x;
  return x + y;
}
int main() {
  cin >> n;
  long long nn = n * n;
  for (long long i = 0; i < nn; i++) cin >> a[i];
  sort(a, a + nn);
  for (long long i = 0; i < nn; i++)
    if (a[i] != a[i - 1] || i == 0) m[a[i]] = 0;
  for (long long i = nn - 1; i >= 0; i--) {
    if (m[a[i]] == 0) {
      for (int j = 0; j < counter; j++) {
        long long g = gcd(a[i], ans[j]);
        m[g] += 2;
      }
      ans[counter++] = a[i];
    } else
      m[a[i]]--;
  }
  for (int i = 0; i < counter; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
