#include <bits/stdc++.h>
using namespace std;
priority_queue<int> H;
int A[250010];
int B[510];
int gcd(int a, int b) {
  int t;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int c = 1; c <= n * n; c++) scanf("%d", &A[c]);
  sort(A + 1, A + 1 + n * n);
  for (int c = n * n; c >= 1 and ans != n; c--) {
    if (H.empty() or H.top() != A[c]) {
      printf("%d ", A[c]);
      ans++;
      B[ans] = A[c];
      for (int d = 1; d <= ans - 1; d++) {
        H.push(gcd(A[c], B[d]));
        H.push(gcd(A[c], B[d]));
      }
    } else if (!H.empty())
      H.pop();
  }
}
