#include <bits/stdc++.h>
using namespace std;
int n, a[250005], ans[250005];
map<int, int> M;
template <typename Drake>
void read(Drake &x) {
  x = 0;
  char ch = getchar();
  bool f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f ^= 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x *= (2 * f - 1);
}
template <typename Drake>
void write(Drake x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename Drake>
void writeln(Drake x) {
  write(x);
  puts("");
}
void init() {
  read(n);
  for (int i = 1; i <= n * n; ++i) {
    read(a[i]);
    M[a[i]]++;
  }
}
int gcd(int Cmp1, int Cmp2) {
  int r = Cmp1 % Cmp2;
  while (r) {
    r = Cmp1 % Cmp2;
    Cmp1 = Cmp2;
    Cmp2 = r;
  }
  return Cmp2;
}
int main() {
  init();
  sort(a + 1, a + n * n + 1);
  reverse(a + 1, a + n * n + 1);
  int Del, Cnt;
  Cnt = 0;
  for (int i = 1; i <= n * n && Cnt < n; ++i)
    if (M[a[i]]) {
      Del = a[i];
      write(Del);
      putchar(' ');
      for (int j = 1; j <= Cnt; ++j) {
        int Gcd = gcd(a[j], Del);
        M[Gcd] -= 2;
      }
      ++Cnt;
      a[Cnt] = a[i];
      M[a[i]]--;
    }
  puts("");
  return 0;
}
