#include <bits/stdc++.h>
using namespace std;
int n, a[600 * 600], N;
char used[600 * 600];
vector<int> answer;
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
void mark(int s) {
  int l = 0, r = N - 1;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (a[m] < s || (a[m] == s && !used[m]))
      l = m;
    else
      r = m;
  }
  used[l] = 1;
  used[l - 1] = 1;
}
int main() {
  scanf("%d", &n);
  N = n * n;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + N);
  for (int i = N - 1; i >= 0; --i) {
    if (!used[i]) {
      used[i] = 1;
      for (int j = 0; j < answer.size(); ++j) {
        int s = gcd(answer[j], a[i]);
        mark(s);
      }
      answer.push_back(a[i]);
    }
  }
  for (int i = 0; i < answer.size(); ++i) {
    printf("%d ", answer[i]);
  }
  return 0;
}
