#include <iostream>
#include <math.h>
using namespace std;
int a[51];
int main()
{
int n, i, num, p;
cin >> n;
for (i=1; i<=n; ++i)
{
cin >> num; p=(int)sqrt(num);
if (sqrt(num)==p) { a[i]=p; ++i; a[i]=num; ++n; }
else a[i]=num;
}
for (i=1; i<=n; ++i)
cout << a[i] << " ";
return 0;
}