#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
long long gcd(long long first, long long second) {
  return !second ? first : gcd(second, first % second);
};
long long x, y, z;
deque<long long> q, pq;
map<long long, long long> p;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  cin >> x;
  for (int i = 0; i < x * x; i++) {
    cin >> y;
    q.push_back(y);
    p[y]++;
  }
  sort(q.rbegin(), q.rend());
  for (auto i : q) {
    if (p[i]) {
      cout << i << " ";
      p[i]--;
      for (auto j : pq) {
        p[gcd(i, j)] -= 2;
      }
      pq.push_back(i);
    }
  }
  cout << endl;
  return 0;
}
