#include <bits/stdc++.h>
using namespace std;
int a[510], pos = 1, b[300000];
map<int, int> cont;
int n, N;
int gcd(int x, int y) {
  while (x && y) {
    x %= y;
    swap(x, y);
  }
  if (x) return x;
  return y;
}
int main() {
  scanf("%d", &n);
  N = n * n;
  for (int i = 1; i <= N; i++) {
    scanf("%d", &b[i]);
    cont[b[i]]++;
  }
  sort(b + 1, b + N + 1);
  for (int i = N; i >= 1; i--)
    while (cont[b[i]] > 0) {
      a[pos] = b[i];
      for (int j = 0; j < pos; j++) cont[gcd(a[pos], a[j])] -= 2;
      pos++;
    }
  for (int i = 1; i < pos; i++) cout << a[i] << " ";
  cin >> n;
  return 0;
}
