#include <bits/stdc++.h>
using namespace std;
const int MAXN = 250005;
int n, i, j, x, cnt, num, a[MAXN], ans[MAXN];
map<int, int> m;
inline void read(int &x) {
  short negative = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  x *= negative;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
inline int gcd(int a, int b) { return (!a) ? b : gcd(b % a, a); }
inline bool cmp(int a, int b) { return a > b; }
signed main(void) {
  read(n);
  for (i = 1; i <= n * n; i++) {
    read(x);
    if (!m[x]) a[++cnt] = x;
    m[x]++;
  }
  sort(a + 1, a + cnt + 1, cmp);
  for (i = 1; i <= cnt && num < n;) {
    while (!m[a[i]]) i++;
    ans[++num] = a[i];
    m[a[i]]--;
    for (j = 1; j < num; j++) m[gcd(ans[j], a[i])] -= 2;
  }
  for (i = 1; i <= num; i++) print(ans[i]), putchar(' ');
  return 0;
}
