#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> occ;
  for (int i = 0; i < N * N; i++) {
    int n;
    cin >> n;
    occ[n]++;
  }
  vector<int> s;
  for (int i = 0; i < N; i++) {
    map<int, int>::iterator last = occ.end();
    last--;
    s.push_back(last->first);
    (last->second)--;
    if (last->second == 0) occ.erase(last);
    for (int j = 0; j < i; j++) {
      int n = gcd(s[j], s[i]);
      occ[n] -= 2;
      if (occ[n] == 0) {
        occ.erase(n);
      }
    }
  }
  for (int x : s) {
    cout << x << " ";
  }
  cout << endl;
}
