#include <bits/stdc++.h>
using namespace std;
int F(const void* l, const void* r) { return (*(int*)l - *(int*)r); }
const long long inf = 1000000000000000003;
int n;
long long a[505001];
map<long long, long long> g;
long long ret(long long x) {
  long double q = x;
  q = sqrt(q);
  return (long long)q;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
vector<long long> g2;
vector<long long> h;
long long ff(long long x) {
  if (x == 1) return 1;
  long long c = 1;
  for (long long i = 0; i < x; i++) c *= 2;
  return c;
}
int main() {
  ios::ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 0; i < n * n; i++) {
    cin >> a[i];
    g[a[i]]++;
  }
  sort(a, a + n * n);
  long long k, t;
  int y = 1, x, z, v = -100, mm = g[40921959];
  long long pi, pi2, pi3, pi4;
  vector<long long> bb;
  long long p;
  for (long long i = n * n - 1; i >= 0; i--) {
    if (g[a[i]] > 0) {
      p = 0;
      k = g[a[i]];
      for (long long j = 0; j < h.size(); j++) {
        t = gcd(a[i], h[j]);
        if (t == a[i]) {
          p += 2 * (-g[h[j]]);
        }
      }
      bb.push_back(k);
      k = (ret(p * p + 4 * k) - p) / 2;
      bb.push_back(k);
      for (long long j = 0; j < h.size(); j++) {
        t = gcd(a[i], h[j]);
        if (t == a[i]) {
        } else {
          if (g[t] != 0) {
            if (g[t] < 0) {
              g[t] -= 2 * (-g[h[j]]) * k;
              if (y != 2) {
                x = a[i];
                z = h[j];
                v = t;
                y = 2;
              }
            } else {
              g[t] -= 2 * (-g[h[j]]) * k;
              if (g[t] < 0) {
                if (y != 2) {
                  x = a[i];
                  z = h[j];
                  v = t;
                  pi = k;
                  pi2 = -g[h[j]];
                  pi3 = g[t];
                  pi4 = g[t] + 2 * (-g[h[j]]) * k;
                  y = 2;
                }
              }
            }
          }
        }
      }
      for (long long j = 0; j < k; j++) g2.push_back(a[i]);
      g[a[i]] = -k;
      if (k > 0) h.push_back(a[i]);
    }
  }
  for (long long i = 0; i < g2.size(); i++) cout << g2[i] << " ";
  return 0;
}
