#include <bits/stdc++.h>
using namespace std;
void printarr(int arr[], int n) {
  for (int i = 0; i < n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}
void printarr(vector<int> arr) {
  int n = arr.size();
  for (int i = 0; i < n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test, ti, n, i, x, y, d, ans, sz, nitr, slc, inp, lrg;
  cin >> n;
  nitr = n * n;
  multiset<int> mp;
  multiset<int>::reverse_iterator itr;
  vector<int> v;
  while (nitr--) {
    cin >> inp;
    mp.insert(inp);
  }
  while (!mp.empty()) {
    d = *mp.crbegin();
    v.push_back(d);
    mp.insert(d);
    for (auto& x : v) {
      mp.erase(mp.find(gcd(x, d)));
      mp.erase(mp.find(gcd(x, d)));
    }
  }
  printarr(v);
  return 0;
}
