#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int n, a[100];
ofstream out("out.txt");
cin >> n;
for (int i=0; i<n; i++)
{
cin >> a[i];
int nr=0, MAX=0, t=a[i];
while(t)
{
if (t%10>MAX) MAX = t%10;
t/=10;
}
for (int j=1; j<=a[i]; j++)
if (a[i]%j==0) nr++;
if (nr%2==1 && MAX%2==0) out << a[i];
}
return 0;
}