#include <bits/stdc++.h>
using namespace std;
int n, pt;
int a[250000];
int ans[500];
map<int, int> table;
bool cmp(int x, int y) { return x > y; }
int count(int x) {
  if (table.find(x) == table.end())
    return 0;
  else
    return table[x];
}
void add(int x) {
  if (table.find(x) == table.end()) table[x] = 0;
  table[x] += 2;
}
int gcd(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return gcd(y, x % y);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) scanf("%d", &a[i]);
  sort(a, a + n * n, cmp);
  pt = 0;
  for (int i = 0; i < n; i++) {
    while (1) {
      int cnt = count(a[pt]);
      if (cnt) {
        table[a[pt]] = cnt - 1;
        pt++;
      } else {
        ans[i] = a[pt++];
        break;
      }
    }
    for (int j = 0; j < i; j++) {
      int tmp = gcd(ans[i], ans[j]);
      add(tmp);
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
