#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
int q[510 * 510];
int ans[510];
int n;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  scanf("%d", &n);
  int i = 1, x, j;
  while (i <= n * n) {
    scanf("%d", &x);
    q[i] = x;
    M[x]++;
    i++;
  }
  sort(q + 1, q + i);
  i = n * n;
  while (i) {
    if (M[q[i]] != 0) {
      M[q[i]]--;
      ans[++ans[0]] = q[i];
      cout << q[i] << endl;
      j = 1;
      while (j < ans[0]) {
        M[gcd(q[i], ans[j])] -= 2;
        j++;
      }
    }
    i--;
  }
  return 0;
}
