#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
map<int, int> m;
int a[510 * 510], ans[510];
int main() {
  int n, i, j, k;
  while (scanf("%d", &n) != EOF) {
    m.clear();
    for (i = 1; i <= n * n; i++) {
      scanf("%d", &a[i]);
      m[a[i]]++;
    }
    sort(a + 1, a + n * n + 1);
    int top = 0;
    for (i = n * n; i >= 1; i--) {
      if (!m[a[i]]) continue;
      ans[top++] = a[i];
      m[a[i]]--;
      for (j = 0; j < top - 1; j++) m[gcd(ans[j], a[i])] -= 2;
    }
    for (i = 0; i < top; i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
