#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, a[510001], b[510001], ans[1101], tmp, w;
int gcd(int a, int b) {
  int r;
  do {
    r = a % b;
    a = b;
    b = r;
  } while (r);
  return a;
}
int bs(int x) {
  int l, r, mid;
  for (l = 1, r = m; l < r - 1;) {
    mid = (l + r) >> 1;
    if (a[mid] >= x)
      r = mid;
    else
      l = mid + 1;
  }
  return (a[l] >= x) ? l : r;
}
int main() {
  ans[0] = 0;
  scanf("%d", &n);
  m = n * n;
  for (i = 1; i <= m; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + m);
  for (i = 1; i <= m; i = j + 1) {
    for (j = i; j < m && a[j + 1] == a[i]; j++)
      ;
    b[i] = j - i + 1;
  }
  for (i = m; i; i = j - 1) {
    for (j = i; j > 1 && a[j - 1] == a[i]; j--)
      ;
    while (b[j]) {
      b[j]--;
      ans[++ans[0]] = a[j];
      for (k = 1; k < ans[0]; k++) {
        w = bs(gcd(ans[k], a[j]));
        b[w] -= 2;
      }
    }
  }
  for (i = 1; i <= n; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
