#include <bits/stdc++.h>
int nod(int, int);
int main() {
  using namespace std;
  int n = 0;
  scanf("%d", &n);
  int matrix[250002] = {0};
  for (int i = 0; i < n * n; i++) {
    scanf("%d", &matrix[i]);
  }
  sort(matrix, matrix + n * n);
  int element[501][2] = {matrix[0], 1}, ne = 0;
  for (int i = 1; i < n * n; i++) {
    if (matrix[i] == element[ne][0]) {
      element[ne][1]++;
    } else {
      ne++;
      element[ne][0] = matrix[i];
      element[ne][1] = 1;
    }
  }
  int ans[501] = {0};
  for (int i = 0, ie = ne; i < n;) {
    if (element[ie][1] > 0) {
      ans[i] = element[ie][0];
      for (int ii = i - 1; ii >= 0; ii--) {
        int nd = nod(ans[ii], ans[i]), iie = ie;
        while (nd < element[iie][0]) {
          iie--;
        }
        element[iie][1] -= 2;
      }
      element[ie][1]--;
      i++;
    } else {
      ie--;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
int nod(int a, int b) {
  if (b != 0) return nod(b, a % b);
  return a;
}
