#include <bits/stdc++.h>
using namespace std;
int n, A[250010];
pair<int, int> P[250010];
int sz;
vector<int> V;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n * n; i++) cin >> A[i];
  sort(A, A + n * n);
  P[sz++] = make_pair(A[0], 1);
  for (int i = 1; i < n * n; i++) {
    if (A[i] == P[sz - 1].first)
      P[sz - 1].second++;
    else
      P[sz++] = make_pair(A[i], 1);
  }
  V.push_back(P[sz - 1].first);
  P[sz - 1].second--;
  while (V.size() < n) {
    if (P[sz - 1].second == 0) sz--;
    for (int i = 0; i < V.size(); i++) {
      if (V[i] % P[sz - 1].first == 0) {
        P[sz - 1].second -= 2;
      }
    }
    if (P[sz - 1].second) {
      V.push_back(P[sz - 1].first);
      P[sz - 1].second--;
    }
  }
  for (int i = 0; i < V.size(); i++) cout << V[i] << ' ';
}
