#include <bits/stdc++.h>
using namespace std;
multiset<int> se;
int n, a[10000];
int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    int x;
    scanf("%d", &x);
    se.insert(x);
  }
  for (int i = 1; i <= n; i++) {
    a[i] = *(--se.end());
    for (int j = 1; j <= i - 1; j++) {
      se.erase(se.find(gcd(a[i], a[j])));
      se.erase(se.find(gcd(a[i], a[j])));
    }
    se.erase(se.find(a[i]));
    printf("%d ", a[i]);
  }
}
