#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
map<int, int> ma;
int n;
priority_queue<int> que;
int ori[maxn];
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int main() {
  while (~scanf("%d", &n)) {
    ma.clear();
    for (int i = 0, a; i < n * n; i++) {
      scanf("%d", &a);
      que.push(a);
      if (ma.find(a) == ma.end()) {
        ma[a] = 1;
      } else
        ma[a]++;
    }
    int len = 0;
    while (!que.empty()) {
      int temp = que.top();
      que.pop();
      if (ma[temp] == 0) continue;
      ori[len++] = temp;
      for (int i = 0, now; i < len; i++) {
        now = gcd(temp, ori[i]);
        if (i == len - 1) {
          ma[now]--;
        } else {
          ma[now] -= 2;
        }
      }
    }
    for (int i = 0; i < len; i++) printf("%d ", ori[i]);
    printf("\n");
  }
}
