/*************************************************************************
	> File Name: gcd.cpp
	> Author: Archer
 ************************************************************************/

#include <bits/stdc++.h>
using namespace std;

const int N = 555;
int n, a[N], lst[N];
map<int, int> h;

inline bool cmp(int x, int y){ return x > y; }
int main(){
	scanf("%d", &n);
	for (int i = 1; i <= n * n; i++) scanf("%d", &a[i]);
	
	sort(a + 1, a + 1 + n * n, cmp);
	for (int i = 1; i <= n * n; i++) h[a[i]]++;
	
	int cur = 1, cnt = 0;
	while (cur <= n * n){
		if (h[a[cur]] > 0){
			h[lst[++cnt] = a[cur]]--;
			for (int i = 1; i <= cnt; i++) h[__gcd(lst[i], a[cur])] -= 2;
		}
		cur++;
	}
	for (int i = 1; i < cnt; i++) printf("%d ", lst[i]);
	printf("%d\n", lst[cnt]);
	return 0;
}
