#include <bits/stdc++.h>
using namespace std;
const int MAXN = 250005;
int n, i, j, 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(a[i]);
    m[a[i]]++;
  }
  sort(a + 1, a + n * n + 1, cmp);
  for (i = 1; i <= n * n && num < n; i++) {
    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;
}
