#include <bits/stdc++.h>
using namespace std;
const int MAX = 123456789;
const int inf = 123456789;
const double EPS = 1e-10;
const double PI = 2 * asin(1.0);
const long long mod = 1e9 + 7;
inline int double_cmp(double x, double y = 0, double tol = EPS) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
int gcd(int a, int b) { return (a % b == 0) ? b : gcd(b, a % b); }
int main() {
  int n;
  scanf("%d", &n);
  multiset<int> mdc;
  for (int i = 0; i < n * n; ++i) {
    int aux;
    scanf("%d", &aux);
    mdc.insert(aux);
  }
  vector<int> saida;
  multiset<int>::reverse_iterator it = mdc.rbegin();
  while (((int)saida.size()) != n) {
    int aux = *it;
    mdc.erase(mdc.find(aux));
    for (int i = 0; i < ((int)saida.size()); ++i) {
      int temp = gcd(aux, saida[i]);
      mdc.erase(mdc.find(temp));
      mdc.erase(mdc.find(temp));
    }
    saida.push_back(aux);
    if (((int)mdc.size()) != 0) it = mdc.rbegin();
  }
  for (int i = 0; i < ((int)saida.size()); ++i) printf("%d ", saida[i]);
  printf("\n");
}
