#include <bits/stdc++.h>
using namespace std;
multiset<long long> s;
vector<long long> b;
void remove(long long x) {
  multiset<long long>::iterator it(s.find(x));
  if (it != s.end()) s.erase(it);
}
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
int main() {
  long long n, k, x, y;
  cin >> n;
  k = (n * n);
  for (long long i = 0; i < k; i++) {
    cin >> x;
    s.insert(x);
  }
  x = *s.rbegin();
  b.push_back(x);
  remove(x);
  while (b.size() < n) {
    x = *s.rbegin();
    b.push_back(x);
    remove(x);
    for (int i = 0; i < b.size(); i++) {
      remove(gcd(x, b[i]));
      remove(gcd(x, b[i]));
    }
  }
  for (int i = 0; i < b.size(); i++) cout << b[i] << ' ';
  cout << "\n";
  return 0;
}
