#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n, a[555], b, k;
  map<int, int> m;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> b;
    m[-b]++;
  }
  k = n - 1;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    while (it->second) {
      a[k] = -it->first;
      it->second--;
      for (int j = k + 1; j < n; j++) {
        m[-gcd(a[k], a[j])] -= 2;
      }
      k--;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
}
