#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
vector<int> object, ans;
map<int, int> counter;
int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); }
int main() {
  int n, num;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    scanf("%d", &num);
    object.push_back(num);
  }
  sort(object.begin(), object.end());
  for (int i = object.size() - 1; i >= 0; i--) {
    if (counter[object[i]]) {
      counter[object[i]]--;
      continue;
    }
    for (int j = 0; j < ans.size(); j++) {
      int temp = gcd(ans[j], object[i]);
      counter[temp] += 2;
    }
    ans.push_back(object[i]);
  }
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
