#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> gcds;
  map<int, int> usado, garantido;
  for (int i = 1; i <= n * n; i++) {
    int x;
    scanf("%d", &x);
    gcds.push_back(x);
    usado[x]++;
  }
  sort(gcds.begin(), gcds.end(), greater<int>());
  vector<int> asw;
  asw.push_back(gcds[0]);
  garantido[gcds[0]]++;
  for (int i = 1; i < gcds.size(); i++) {
    int g = gcds[i];
    if (garantido[g] != usado[g]) {
      for (int i = 0; i < asw.size(); i++) garantido[gcd(asw[i], g)] += 2;
      asw.push_back(g);
      garantido[g]++;
    }
  }
  for (int i = 0; i < asw.size(); i++) printf("%d ", asw[i]);
  for (int i = asw.size(); i < n; i++) printf("%d ", asw[0]);
  return 0;
}
