#include <bits/stdc++.h>
using namespace std;
int val[1000111];
map<int, int> f;
vector<int> luu;
int gcd(int x, int y) {
  while (y > 0) {
    x %= y;
    swap(x, y);
  }
  return x;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1), _b = (n * n); i <= _b; ++i) {
    scanf("%d", &val[i]);
    f[val[i]]++;
  }
  sort(val + 1, val + n * n + 1);
  int m = 0;
  for (int i = (n * n), _b = (1); i >= _b; --i) {
    if (f[val[i]] > 0) {
      f[val[i]]--;
      for (int j = 0, _b = (luu.size()); j < _b; ++j)
        f[gcd(val[i], luu[j])] -= 2;
      luu.push_back(val[i]);
    }
  }
  for (int i = 0, _b = (luu.size()); i < _b; ++i) printf("%d ", luu[i]);
  return 0;
}
