#include <bits/stdc++.h>
using namespace std;
int n, m, sg[500050][2], t[500050], st, v[505], cnt;
inline int Read() {
  int x = 0;
  char y;
  do y = getchar();
  while (y < '0' || y > '9');
  do x = x * 10 + y - '0', y = getchar();
  while (y >= '0' && y <= '9');
  return x;
}
int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }
int Half_Find(int x, int y, int z) {
  int i = x + y >> 1;
  if (sg[i][0] == z) return i;
  return sg[i][0] < z ? Half_Find(i + 1, y, z) : Half_Find(x, i - 1, z);
}
int sqr(int x) { return x * x; }
int main() {
  n = Read();
  for (int i = 1; i <= n * n; i++) t[i] = Read();
  sort(t + 1, t + n * n + 1);
  t[0] = -1;
  for (int i = 1; i <= n * n; i++) {
    st += t[i] != t[i - 1];
    sg[st][0] = t[i];
    sg[st][1]++;
  }
  for (int i = st; i >= 1; i--) {
    int q = 0, w = 0, e = cnt;
    for (int j = 1; j <= cnt; j++)
      if (v[j] % sg[i][0] == 0) q++;
    sg[i][1] += q * q;
    sg[i][1] = sqrt(sg[i][1]) - q;
    if (!sg[i][1]) continue;
    while (sg[i][1]--) v[++cnt] = sg[i][0];
    for (int j = 1; j <= e; j++)
      sg[Half_Find(1, st, gcd(v[j], sg[i][0]))][1] -= 2 * (cnt - e);
  }
  for (int i = 1; i <= n; i++) printf("%d ", v[i]);
  puts("");
  return 0;
}
