#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int arr[n * n];
  n = n * n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    mp[arr[i]]++;
  }
  vector<int> ans;
  int cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (mp[arr[i]] > 0) {
      for (int j = 0; j < ans.size(); j++) {
        mp[gcd(ans[j], arr[i])] -= 2;
      }
      ans.push_back(arr[i]);
      mp[arr[i]]--;
      cnt++;
      if (cnt == sqrt(n)) break;
    }
  }
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
