#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int a[620 * 620];
map<int, int> H;
vector<int> ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    scanf("%d", &a[i]);
    H[a[i]]++;
  }
  sort(a + 1, a + n * n + 1);
  for (int i = n * n; i; i--) {
    if (!H[a[i]]) continue;
    H[a[i]]--;
    for (int j = 0; j < ans.size(); j++) H[gcd(ans[j], a[i])] -= 2;
    ans.push_back(a[i]);
  }
  cout << ans[0];
  for (int i = 1; i <= n - 1; i++) cout << " " << ans[i];
  cout << endl;
}
