#include <bits/stdc++.h>
using namespace std;
int gcd(const int a, const int b) { return !b ? a : gcd(b, a % b); }
int ans[502];
map<int, int> c;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * n; i++) {
    int a;
    scanf("%d", &a);
    c[-a]++;
  }
  int j = n - 1;
  for (auto it = c.begin(); it != c.end(); it++) {
    const int g = -it->first;
    while (it->second--) {
      ans[j] = g;
      for (int i = j + 1; i < n; i++) {
        c[-gcd(ans[j], ans[i])] -= 2;
      }
      j--;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
