#include <bits/stdc++.h>
using namespace std;
long long myfunction(const long long &a, const long long &b) {
  if (a * b == 0) {
    return a + b;
  }
  return a > b ? myfunction(a % b, b) : myfunction(b % a, a);
}
int main() {
  int n;
  multiset<long long> arr;
  long long temp;
  cin >> n;
  int stop = n * n;
  while (stop) {
    cin >> temp;
    arr.insert(temp);
    stop--;
  }
  int count = 0;
  long long max;
  vector<long long> result;
  while (count < n) {
    max = *arr.rbegin();
    for (int i = 0; i < result.size(); i++) {
      long long temp = myfunction(max, result[i]);
      arr.erase(arr.find(temp));
      arr.erase(arr.find(temp));
    }
    result.push_back(max);
    cout << max << " ";
    count++;
    arr.erase(arr.find(max));
  }
  return 0;
}
