#include <bits/stdc++.h>
using namespace std;
const int MAXN = 510;
int n;
int arr[MAXN * MAXN];
map<int, int> mapa;
vector<int> rjesenje;
int gcd(int a, int b) {
  if (!a) return b;
  return gcd(b % a, a);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    scanf("%d", &arr[i]);
    mapa[arr[i]]++;
  }
  sort(arr + 1, arr + (n * n) + 1);
  for (int i = n * n; i >= 1; i--) {
    if (mapa[arr[i]] > 0) {
      while (mapa[arr[i]] > 0) {
        int sada = arr[i];
        rjesenje.push_back(arr[i]);
        for (int j = 0; j < (int)rjesenje.size(); j++) {
          mapa[gcd(sada, rjesenje[j])] -= 2;
        }
      }
    }
  }
  for (int i = 0; i < (int)rjesenje.size(); i++) printf("%d ", rjesenje[i]);
  return 0;
}
