#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  multiset<int> save;
  int a[500];
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int temp;
    cin >> temp;
    save.insert(temp);
  }
  for (int j = 0; j < n; j++) {
    multiset<int>::reverse_iterator it = save.rbegin();
    a[j] = *it;
    save.erase(save.find(a[j]));
    for (int p = 0; p < j; p++) {
      save.erase(save.find(gcd(a[p], a[j])));
      save.erase(save.find(gcd(a[p], a[j])));
    }
    cout << a[j] << " ";
  }
  return 0;
}
