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