#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int c = min(a, b);
  a = max(a, b);
  b = c;
  while (b != 0) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
map<int, int> cnt;
int ans[1000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    int a;
    scanf("%d", &a);
    cnt[-a]++;
  }
  int pos = n - 1;
  for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
    int x = -it->first;
    while (it->second) {
      ans[pos] = x;
      --it->second;
      for (int i = pos + 1; i < n; ++i) cnt[-gcd(ans[pos], ans[i])] -= 2;
      pos--;
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
