#include <bits/stdc++.h>
using namespace std;
const int Maxn = 500 * 500 + 10;
vector<int> numbers;
vector<int> origin;
int Count[Maxn];
vector<int> a;
int gcd(int n, int m) { return n % m == 0 ? m : gcd(m, n % m); }
int get(int x) {
  return lower_bound(numbers.begin(), numbers.end(), x) - numbers.begin();
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    origin.push_back(x);
    numbers.push_back(x);
  }
  sort(origin.begin(), origin.end());
  sort(numbers.begin(), numbers.end());
  numbers.erase(unique(numbers.begin(), numbers.end()), numbers.end());
  for (int i = 0; i < origin.size(); i++) Count[get(origin[i])]++;
  for (int i = origin.size() - 1; i >= 0; i--) {
    if (Count[get(origin[i])] == 0) continue;
    int x = origin[i];
    a.push_back(x);
    Count[get(x)]--;
    for (int j = 0; j < a.size() - 1; j++) Count[get(gcd(a[j], x))] -= 2;
  }
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  return 0;
}
