#include <bits/stdc++.h>
#define endl '\n'

//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

using namespace std;
template<class T, class T2> inline int chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline int chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
const int MAXN = (1 << 10);

int n;
int a[MAXN][MAXN];

void read()
{
	int v;
	cin >> v;

	n = sqrt(v);
	while(n * n < v) n++;
	while(n * n > v) n--;

	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++)
			cin >> a[i][j];
}

int cnt[MAXN << 13];

void solve()
{
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++)
			cnt[a[i][j]]++;

	vector<int> cands;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++)
		{
			int x = sqrt(a[i][j]);
			while(x * x < a[i][j]) x++;
			while(x * x > a[i][j]) x--;

			if(x * x == a[i][j])
				cands.push_back(x);
		}

	sort(cands.begin(), cands.end());

	vector<int> answer;
	for(int i: cands)
	{
		bool ok = 1;
		for(int j: answer)
		{
			if(cnt[i * j] < 2) ok = 0;
			cnt[i * j] -= 2;
		}

		if(ok && cnt[i * i])
		{
			cnt[i * i]--;
			answer.push_back(i);
		}
		else
			for(int j: answer)
				cnt[i * j] += 2;
	}
	

	for(int i: answer)
		cout << i << " ";
	cout << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	read();
	solve();
	return 0;
}

