#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
int n, x, y;
map<int, int> mp;
vector<int> v;
void check(int x) {
  if (mp[x] == 0) mp.erase(x);
}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n * n; i++) cin >> x, mp[x]++;
  while (v.size() < n) {
    x = mp.rbegin()->first;
    mp[x]--;
    check(x);
    for (int i = 0; i < v.size(); i++) {
      y = gcd(x, v[i]);
      mp[y] -= 2;
      check(y);
    }
    v.push_back(x);
  }
  for (auto x : v) cout << x << " ";
  cout << endl;
  return 0;
}
