#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 500 + 10;
long long a[MAX_N * MAX_N];
map<int, int> t;
vector<int> vec;
long long GCD(long long a, long long b) {
  while (true) {
    if (a == 0) return b;
    b %= a;
    if (b == 0) return a;
    a %= b;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> a[i];
    t[a[i]]++;
  }
  sort(a, a + n * n);
  for (int i = n * n - 1; i >= 0; i--) {
    if (t[a[i]] > 0) {
      cout << a[i] << " ";
      vec.push_back(a[i]);
      for (int j = 0; j < vec.size(); j++) t[GCD(a[i], vec[j])] -= 2;
      t[a[i]]--;
    }
  }
  cout << endl;
  return 0;
}
