#include <bits/stdc++.h>
using namespace std;
int n, m;
int flag, sum, ave, ans, res, len, ans1, ans2;
int a[302345], b[302345];
char s[101];
struct node {
  int x, y;
  int r, w;
  int to, next;
  void init() { r = 0; }
  friend bool operator<(node a, node b) { return a.r > b.r; }
} tn;
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() {
  int i, j, k, kk, t, x, y, z;
  while (scanf("%d", &n) != EOF && n) {
    for (i = 1; i <= n * n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n * n + 1);
    priority_queue<int, vector<int>, less<int> > q;
    k = 0;
    for (i = n * n; i > 0; i--) {
      if (!q.empty())
        t = q.top();
      else
        t = 0;
      if (a[i] == t) {
        q.pop();
        continue;
      }
      for (j = 0; j < k; j++) {
        x = gcd(b[j], a[i]);
        q.push(x);
        q.push(x);
      }
      b[k++] = a[i];
    }
    printf("%d", b[0]);
    for (i = 1; i < k; i++) printf(" %d", b[i]);
    printf("\n");
  }
  return 0;
}
