#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int n;
multiset<int> bank;
vector<int> ans;
void sh() {
  printf("CurrentSet: ");
  for (multiset<int>::iterator it = bank.begin(); it != bank.end(); it++)
    printf("%d ", *it);
  printf("\n");
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    int q;
    scanf("%d", &q);
    bank.insert(q);
  }
  for (int i = 0; i < n; i++) {
    multiset<int>::iterator it = bank.end();
    it--;
    int x = *it;
    multiset<int>::iterator qq = bank.find(x);
    bank.erase(qq);
    for (int j = 0; j < ans.size(); j++) {
      multiset<int>::iterator ti = bank.find(gcd(x, ans[j]));
      bank.erase(ti);
      ti = bank.find(gcd(x, ans[j]));
      bank.erase(ti);
    }
    ans.push_back(x);
  }
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
