#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int main() {
  map<int, int> mp1;
  int n;
  scanf("%d", &n);
  vector<int> A;
  for (int i = 0; i < n * n; i++) {
    int a;
    scanf("%d", &a);
    A.push_back(a);
    mp1[a]++;
  }
  sort(A.begin(), A.end());
  if (n == 1)
    cout << A.back() << "\n";
  else {
    int a = A[(int)A.size() - 1];
    vector<int> ans;
    ans.push_back(a);
    mp1[a]--;
    int nxt = (int)A.size() - 2;
    while ((int)ans.size() < n && nxt >= 0) {
      int x = A[nxt];
      if (mp1[x] <= 0) {
        --nxt;
        continue;
      }
      mp1[x]--;
      --nxt;
      for (int i = 0; i < (int)ans.size(); i++) {
        int g = gcd(ans[i], x);
        mp1[g] -= 2;
      }
      ans.push_back(x);
    }
    for (int a : ans) cout << a << " ";
  }
}
