#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
int num[maxn * maxn];
int n;
vector<int> ans;
map<int, int> m;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  while (~scanf("%d", &n)) {
    n *= n;
    for (int i = 0; i < n; ++i) scanf("%d", num + i);
    sort(num, num + n);
    ans.clear();
    m.erase(m.begin(), m.end());
    for (int i = n - 1; i >= 0; --i) {
      if (m[num[i]] == 0) {
        for (int j = 0; j < ans.size(); ++j) m[gcd(ans[j], num[i])] += 2;
        ans.push_back(num[i]);
      } else
        --m[num[i]];
    }
    for (int i = 0; i < ans.size(); ++i) {
      if (i > 0) printf(" ");
      printf("%d", ans[i]);
    }
    printf("\n");
  }
  return 0;
}
