#include <bits/stdc++.h>
using namespace std;
using std::map;
const int CMAX = 100005;
const char Cfd[] = "", Cfr[] = "";
map<int, int> cnt;
vector<int> nums;
int gcd(int n1, int n2) { return (n2 == 0) ? n1 : gcd(n2, n1 % n2); }
void decount(int x) {
  for (int i = 0; i < nums.size(); i++) cnt[gcd(x, nums[i])] -= 2;
}
int main() {
  int n;
  int x;
  vector<int> v;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> x;
    if (cnt[x] == 0) v.push_back(x);
    cnt[x]++;
  }
  sort(v.begin(), v.end());
  int res = 0;
  while (!v.empty() && res < n) {
    int top = v.back();
    v.pop_back();
  again:
    int c = cnt[top];
    if (c == 0) continue;
    cnt[top]--;
    cout << top << " ";
    decount(top);
    nums.push_back(top);
    goto again;
  }
  return 0;
}
