#include <bits/stdc++.h>
using namespace std;
vector<int> X, List;
map<int, int> Memo;
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int a;
    cin >> a;
    if (Memo[a] == 0) X.push_back(a);
    Memo[a]++;
  }
  sort(X.begin(), X.end());
  int j = X.size() - 1;
  while (!(X.empty())) {
    while (Memo[X[j]] == 0) {
      X.pop_back();
      if (X.empty()) break;
      j = X.size() - 1;
    }
    if (X.empty()) break;
    List.push_back(X[j]);
    Memo[X[j]]--;
    for (int k = 0; k < List.size() - 1; k++) {
      int b = gcd(X[j], List[k]);
      Memo[b] -= 2;
    }
    j = X.size() - 1;
  }
  for (int j = 0; j < List.size(); j++) cout << List[j] << " ";
  cout << endl;
}
