#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int n;
int ans[5005], a[250005];
inline int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  while (scanf("%d", &n) != EOF) {
    m.clear();
    int tot = 0;
    for (int i = 1; i <= n * n; i++) {
      int x;
      scanf("%d", &a[i]);
      m[a[i]]++;
    }
    map<int, int>::reverse_iterator it = m.rbegin();
    memset(ans, 0, sizeof(ans));
    for (; it != m.rend(); ++it) {
      if (it->second == 0) continue;
      while (it->second > 0) {
        ans[++tot] = it->first;
        it->second--;
        for (int i = 0; i < tot; i++) {
          int dd = gcd(ans[i], it->first);
          m[dd] -= 2;
        }
      }
    }
    for (int i = 1; i <= tot; i++)
      if (i != tot)
        printf("%d ", ans[i]);
      else
        printf("%d", ans[i]);
    printf("\n");
  }
  return 0;
}
