#include <bits/stdc++.h>
using namespace std;
int hcf(int n1, int n2) {
  if (n2 != 0)
    return hcf(n2, n1 % n2);
  else
    return n1;
}
int main() {
  int n;
  scanf("%d", &n);
  int a;
  map<int, int> mp;
  vector<int> v;
  for (int i = 0; i < n * n; i++) {
    scanf("%d", &a);
    mp[a]++;
  }
  map<int, int>::iterator it;
  int g = 0;
  it = mp.end();
  it--;
  for (;; --it) {
    int x = it->first;
    if (n == g) break;
    if (mp[x] != 0) {
      mp[x]--;
      g++;
      v.push_back(x);
      while (1) {
        for (int i = g - 2; i >= 0; i--) {
          mp[hcf(v[i], x)] -= 2;
        }
        if (mp[x] == 0) {
          break;
        }
        mp[x]--;
        g++;
        v.push_back(x);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", v[i]);
  }
}
