#include <bits/stdc++.h>
using namespace std;
long long e = 1000000007;
void traverse(vector<int> v) {
  for (int i = 0; i < v.size(); ++i) cout << v[i] << " ";
  cout << "\n";
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
map<int, int> m;
int ans[1005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j, k, l, n, x, test;
  cin >> n;
  for (int i = 0; i < (n * n); i++) {
    cin >> k;
    m[-k]++;
  }
  int pos = n - 1;
  for (map<int, int>::iterator itr = m.begin(); itr != m.end(); itr++) {
    x = -itr->first;
    while (itr->second--) {
      ans[pos] = x;
      for (j = pos + 1; j < n; j++) m[-gcd(x, ans[j])] -= 2;
      pos--;
    }
  }
  for (int i = 0; i < (n); i++) cout << ans[i] << " ";
  return 0;
}
