#include <bits/stdc++.h>
using namespace std;
struct node {
  long long a, b;
  bool operator<(const node &n) const { return a < n.a; }
};
struct node2 {
  long long a;
  long long b;
  bool operator<(const node2 &n) const { return b > n.b; }
};
long long n, m, k;
vector<long long> v, v2, v3, v4;
vector<char> vc;
vector<string> vs, vs2;
string s, s2, s3;
vector<node> vn, vn2, vn3;
vector<long long> G[100005];
vector<node2> vnn;
map<long long, long long> mp, mp2;
int par[100005];
int ran[100005];
void init(int n) {
  for (int i = 0; i < n; i++) {
    par[i] = i;
    ran[i] = 0;
  }
}
int findd(int x) {
  if (par[x] == x) {
    return x;
  } else {
    return par[x] = findd(par[x]);
  }
}
void unite(int x, int y) {
  x = findd(x);
  y = findd(y);
  if (x == y) return;
  par[x] = y;
}
bool same(int x, int y) { return findd(x) == findd(y); }
struct edge {
  int u, v, w;
};
int f[311];
int findd2(int x) {
  if (x != f[x]) f[x] = findd2(f[x]);
  return f[x];
}
void join(int x, int y) {
  int fx, fy;
  fx = findd2(x);
  fy = findd2(y);
  if (fx != fy) f[fx] = fy;
}
struct listnode {
  listnode *next, *pre;
  long long a;
};
struct cmp {
  bool operator()(const node &n1, const node &n2) { return n1.b < n2.b; }
};
long long sum[200005];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  long long t, t2, t3;
  while (cin >> n) {
    v.clear();
    v2.clear();
    mp.clear();
    for (int i = 0; i < n * n; i++) {
      cin >> t;
      v.push_back(t);
    }
    sort(v.begin(), v.end(), greater<long long>());
    for (int i = 0; i < v.size(); i++) {
      mp[v[i]]++;
    }
    for (int i = 0; i < v.size(); i++) {
      if (mp[v[i]] == 0)
        continue;
      else {
        mp[v[i]]--;
        for (int j = 0; j < v2.size(); j++) {
          mp[gcd(v[i], v2[j])] -= 2;
        }
        v2.push_back(v[i]);
      }
    }
    for (int i = 0; i < v2.size(); i++) {
      cout << v2[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
