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