#include <bits/stdc++.h>
using namespace std;
map<long long, int> mp;
set<long long> s;
long long val[501];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int N, x;
  cin >> N;
  for (int i = 0; i < N * N; i++) {
    cin >> x;
    mp[-x]++;
    s.insert(-x);
  }
  int last = N - 1;
  for (long long aux : s) {
    x = -aux;
    while (mp[aux] > 0) {
      cout << x << ' ';
      val[last] = x;
      for (int i = last + 1; i < N; i++) {
        int y = gcd(val[i], x);
        mp[-y] -= 2;
      }
      last--;
      mp[aux]--;
    }
  }
  return 0;
}
