/* In the name of Allah */

#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
typedef pair<int,int> pii;
const int max_n= 500*500+5;
int a[max_n];
map<int,int> mp;
int main(){
	int n;
	cin >> n;
	for(int i=0;i<n*n;i++)
		cin >> a[i];
	sort(a,a+n*n, greater<int>());
	a[n*n]=-1;
	vector<pii> num;
	for(int i=0;i<n*n;i++){
		int co=1;
		while(a[i]== a[i+1]){
			i++;
			co++;
		}
		int c=0;
		for(auto j: num)
			if( j.first % a[i]==0 ) c+= j.second;
		co-= mp[a[i]];
		int id= 4*co + c*c;
		id= sqrt(id);
		id-= c; id/=2;
		for(int k=0;k<id;k++)
			cout<< a[i] << ' ';

		for(auto j: num)
			mp[__gcd(a[i], j.first)]+= id*j.second;
		num.push_back(pii(a[i],id));

	}
}
