#include <bits/stdc++.h>
using namespace std;
const int SIZE = 500 + 10;
int data[SIZE];
map<int, int> all_nums;
int n;
bool used[SIZE * SIZE];
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
void make_data() {
  srand(time(0));
  int n = 5;
  int data[SIZE];
  for (int i = 0; i < n; i++) data[i] = (rand() % (10));
  FILE* output = fopen("input.txt", "w");
  fprintf(output, "%d\n", n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) fprintf(output, "%d ", gcd(data[i], data[j]));
  fclose(output);
}
int main() {
  cin >> n;
  int val;
  for (int i = 0; i < n * n; i++) {
    cin >> val;
    all_nums[val]++;
  }
  auto iter = all_nums.rbegin();
  data[n - 1] = iter->first;
  iter->second--;
  int curtop = n - 1;
  for (int i = 0; i < n - 1; i++) {
    while (all_nums.rbegin()->second == 0) {
      all_nums.erase(all_nums.find(all_nums.rbegin()->first));
    }
    data[curtop - 1] = all_nums.rbegin()->first;
    all_nums.rbegin()->second--;
    for (int k = curtop; k < n; k++)
      all_nums[gcd(data[curtop - 1], data[k])] -= 2;
    curtop--;
  }
  for (int i = 0; i < n; i++) cout << data[i] << " ";
  cout << endl;
  return 0;
}
