#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000")
using namespace std;
map<int, int> ans;
vector<pair<int, int> > vec;
vector<int> anw;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main() {
  int n, i;
  scanf("%d", &n);
  int x;
  for (i = 1; i <= n * n; ++i) {
    scanf("%d", &x);
    ans[x]++;
  }
  for (map<int, int>::iterator it = ans.begin(); it != ans.end(); ++it) {
    vec.push_back(*it);
  }
  sort(vec.begin(), vec.end(), cmp);
  for (vector<pair<int, int> >::iterator it = vec.begin(); it != vec.end();
       ++it) {
    int sum = 0;
    for (i = 0; i < anw.size(); ++i) {
      if (anw[i] % it->first == 0) sum += 2;
    }
    int val = 1;
    while (val * val + val * sum <= it->second) anw.push_back(it->first), val++;
  }
  for (i = 0; i < n; ++i) printf("%d%c", anw[i], i == n ? '\n' : ' ');
  return 0;
}
