#include <bits/stdc++.h>
using namespace std;
int n, m, a[250011], ans[1003];
map<int, int> mp;
map<int, int>::iterator it;
int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }
int main() {
  int x, y;
  scanf("%d", &n);
  m = n * n;
  mp.clear();
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]), mp[-a[i]]++;
  int i = 1;
  for (it = mp.begin(); it != mp.end();) {
    int x = -(*it).first;
    if ((*it).second == 0) {
      it++;
      continue;
    }
    ans[i] = x;
    mp[-x]--;
    for (int j = 1; j < i; j++) mp[-gcd(ans[j], x)] -= 2;
    i++;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  cout << endl;
}
