#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int a[N];
int n;
map<int, int> cnt;
vector<int> ans;
int gcd(int a, int b) {
  while (a > 0 && b > 0) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return (a + b);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n * n; ++i) {
    scanf("%d", &a[i]);
    cnt[a[i]]++;
  }
  sort(a, a + n * n);
  reverse(a, a + n * n);
  if (n == 1) {
    printf("%d\n", a[0]);
    return 0;
  }
  for (int i = 0; i < n * n; ++i) {
    if (cnt[a[i]] > 0) {
      cnt[a[i]]--;
      for (int j = 0; j < ans.size(); ++j) {
        int g = gcd(ans[j], a[i]);
        cnt[g] -= 2;
      }
      ans.push_back(a[i]);
    }
  }
  for (int i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
