#include <bits/stdc++.h>
using namespace std;
int matrix[501 * 501];
int arr[501];
map<int, int> mp;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    scanf("%d", &matrix[i]);
    mp[-matrix[i]]++;
  }
  map<int, int>::iterator it;
  int pos = n - 1;
  for (it = mp.begin(); it != mp.end(); it++) {
    int x = -(*it).first;
    int y = (*it).second;
    while ((*it).second > 0) {
      arr[pos] = x;
      (*it).second = (*it).second - 1;
      for (int i = pos + 1; i < n; i++) {
        int t = gcd(arr[pos], arr[i]);
        mp[-t] = mp[-t] - 2;
      }
      pos--;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", arr[i]);
  }
  return 0;
}
