#include <bits/stdc++.h>
using namespace std;
int n, input, a[1000];
multiset<int> s;
int gcd(int a, int b) {
  while (b != 0) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < (n * n); i++) {
    cin >> input;
    s.insert(input);
  }
  for (int i = 0; i < n; i++) {
    a[i] = *(--s.end());
    for (int j = 0; j < i; j++) {
      s.erase(s.find(gcd(a[i], a[j])));
      s.erase(s.find(gcd(a[i], a[j])));
    }
    s.erase(--s.end());
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
