#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int a[300005];
map<int, int> m;
set<int> s;
vector<int> v;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    scanf("%d", &a[i]);
    m[a[i]]++;
    s.insert(a[i]);
  }
  while ((int)(v.size()) < n) {
    auto it = s.end();
    it--;
    int x = *it;
    v.push_back(x);
    m[x]--;
    if (m[x] == 0) {
      s.erase(x);
    }
    for (int i = 0; i < (int)(v.size()) - 1; i++) {
      int g = gcd(v[i], x);
      m[g] -= 2;
      if (m[g] == 0) s.erase(g);
    }
  }
  for (int i = 0; i < n; i++) {
    cout << v[i] << ' ';
  }
  cout << endl;
  return 0;
}
