#include <bits/stdc++.h>
using namespace std;
const int MAXN = 513;
int N, ans[MAXN];
multiset<int> m;
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  for (int k = N; k >= 1; k--) {
    ans[k] = -(*m.begin());
    m.erase(m.find(-ans[k]));
    for (int i = k + 1; i <= N; i++) {
      m.erase(m.find(-gcd(ans[k], ans[i])));
      m.erase(m.find(-gcd(ans[k], ans[i])));
    }
  }
}
int main() {
  scanf("%d", &N);
  int x;
  for (int i = 1; i <= N * N; i++) {
    scanf("%d", &x);
    m.insert(-x);
  }
  solve();
  for (int i = 1; i <= N; i++) printf("%d%c", ans[i], " \n"[i == N]);
  return 0;
}
