#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return (a > b); }
int gcd(int a, int b) {
  int c;
  while (b > 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
map<int, int> c;
const int MAXN = 250000;
int main() {
  static int a[MAXN], v[MAXN];
  int i, n, m, j, f;
  scanf("%d", &n);
  for (i = m = 0; i < n * n; ++i) {
    scanf("%d", a + i);
    c[a[i]]++;
  }
  sort(a, a + n * n, cmp);
  for (i = 0; i < n * n; ++i)
    if (c[a[i]] > 0) {
      for (j = 0; j < m; ++j)
        for (f = 0; f < 2; ++f) c[gcd(v[j], a[i])]--;
      c[a[i]]--;
      v[m++] = a[i];
    }
  for (i = 0; i < m; ++i) cout << v[i] << ' ';
  return 0;
}
