#include <bits/stdc++.h>
using namespace std;
int n, a[250010], cnt, ans[510];
inline bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n * n + 1, cmp);
  ans[++cnt] = a[1];
  int now = 2;
  while (now <= n * n && cnt < n) {
    ans[++cnt] = a[now];
    int t = a[now];
    for (int i = 1; i < cnt; i++)
      if (ans[i] % t == 0) now += 2;
    now++;
  }
  for (int i = n; i >= 1; i--) printf("%d ", ans[i]);
  return 0;
}
