#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;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    m[(-x)]++;
  }
  map<int, int>::iterator it;
  int ar[250000];
  int temp = 0;
  for (it = m.begin(); it != m.end(); it++) {
    while ((*it).second > 0) {
      ((*it).second)--;
      for (int i = 0; i < temp; i++) {
        m[-gcd(ar[i], -((*it).first))] -= 2;
      }
      ar[temp++] = -((*it).first);
    }
  }
  for (int i = 0; i < temp; i++) cout << ar[i] << " ";
  cout << endl;
}
