#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
map<long long, long long> arr;
int main() {
  ios::sync_with_stdio(false);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int n;
  long long temp;
  cin >> n;
  vector<long long> answer(n);
  long long position = n - 1;
  for (int i = 0; i < n * n; i++) cin >> temp, arr[temp]++;
  for (auto it = arr.rbegin(); it != arr.rend(); it++) {
    int x = it->first;
    while (it->second) {
      answer[position] = x;
      --it->second;
      for (int i = position + 1; i < n; ++i)
        arr[gcd(answer[position], answer[i])] -= 2;
      position--;
    }
  }
  for (int i = 0; i < n; i++) cout << answer[i] << " ";
  return 0;
}
