#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 0, s = 0;
  char ch = getchar();
  while (!isdigit(ch)) f |= ch == '-', ch = getchar();
  while (isdigit(ch)) s = s * 10 + (ch ^ 48), ch = getchar();
  return f ? -s : s;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 510;
int n, top, ans[maxn], num, b[maxn * maxn];
map<int, int> m;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
signed main() {
  n = read();
  for (int i = 1; i <= n * n; i++) {
    int x;
    x = read();
    if (!m[x]) b[++num] = x;
    m[x]++;
  }
  sort(b + 1, b + 1 + num);
  for (int i = num; i >= 1;) {
    while (!m[b[i]]) i--;
    ans[++top] = b[i];
    m[b[i]]--;
    for (int j = 1; j < top; j++) m[gcd(b[i], ans[j])] -= 2;
    if (top >= n) break;
  }
  for (int i = 1; i <= top; i++) print(ans[i]), putchar(' ');
  return 0;
}
