#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-';) ch = getchar();
  int d = 0, t = 1;
  if (ch == '-') {
    t = -1;
    ch = getchar();
  }
  for (; ch >= '0' && ch <= '9'; ch = getchar()) d = d * 10 + ch - 48;
  return d * t;
}
int a[250010], b[250010], ans[250010];
bool ok[250010];
int gcd(int x, int y) {
  while (y) {
    int r = x % y;
    x = y;
    y = r;
  }
  return x;
}
int main() {
  int n = read();
  for (int i = 1; i <= n * n; i++) a[i] = read();
  sort(a + 1, a + n * n + 1);
  memset(ok, 0, sizeof(ok));
  for (int i = 1; i <= n; i++) {
    int k;
    for (int j = n * n; j; j--)
      if (!ok[j]) {
        k = j;
        break;
      }
    ok[k] = 1;
    ans[i] = a[k];
    printf("%d ", ans[i]);
    for (int j = 1; j < i; j++) b[2 * j - 1] = b[2 * j] = gcd(ans[i], ans[j]);
    sort(b + 1, b + 2 * i - 1);
    int p = 1;
    for (int j = 1; j <= 2 * (i - 1); j++) {
      while ((ok[p]) || (a[p] != b[j])) p++;
      ok[p] = 1;
      p++;
    }
  }
  return 0;
}
