#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
int LCM(int a, int b) { return (a * b) / gcd(a, b); }
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
int main() {
  int n, k;
  scanf("%d", &n);
  multiset<int> second;
  for (int(i) = 0; (i) < (n * n); (i)++) {
    scanf("%d", &k);
    second.insert(k);
  }
  vector<int> Arr;
  while (n--) {
    auto it = second.end();
    it--;
    k = *it;
    Arr.push_back(k);
    for (int(i) = 0; (i) < (Arr.size()); (i)++) {
      if (second.find(gcd(k, Arr[i])) != second.end()) {
        second.erase(second.find(gcd(k, Arr[i])));
        if (second.find(gcd(k, Arr[i])) != second.end())
          second.erase(second.find(gcd(k, Arr[i])));
      }
    }
  }
  for (int(i) = 0; (i) < (Arr.size()); (i)++) {
    cout << Arr[i] << " ";
  }
  return 0;
}
