#include <bits/stdc++.h>
using namespace std;
int a[312345], b[312345], n, m;
int gcd(int x, int y) {
  if (x < y) x ^= y, y ^= x, x ^= y;
  int t;
  while (y) t = y, y = x % y, x = t;
  return x;
}
int main() {
  while (scanf("%d", &n) != EOF && n) {
    for (int i = 1; i <= n * n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n * n + 1);
    priority_queue<int, vector<int>, less<int> > pq;
    int k = 0;
    for (int i = n * n; i > 0; i--) {
      int t, x;
      if (!pq.empty())
        t = pq.top();
      else
        t = 0;
      if (a[i] == t) {
        pq.pop();
        continue;
      }
      for (int j = 0; j < k; j++) {
        x = gcd(b[j], a[i]);
        pq.push(x);
        pq.push(x);
      }
      b[k++] = a[i];
    }
    printf("%d", b[0]);
    for (int i = 1; i < k; i++) printf(" %d", b[i]);
    printf("\n");
  }
  return 0;
}
