#include <bits/stdc++.h>
using namespace std;
int pre[505];
int a[505 * 505];
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
map<int, int> s;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) scanf("%d", &a[i]), s[a[i]]++;
  ;
  sort(a, a + n * n);
  reverse(a, a + n * n);
  int cnt = 0;
  for (int i = 0; i < n * n; i++) {
    if (s[a[i]] > 0) {
      printf("%d ", a[i]);
      s[a[i]]--;
      for (int j = 0; j < cnt; j++) {
        s[gcd(a[i], pre[j])] -= 2;
      }
      pre[cnt++] = a[i];
    }
  }
  printf("\n");
  return 0;
}
