#include <iostream>
using namespace std;
int v[300];
int nrdiv(int m)
{
int nr=0, i;
for (i=1; i*i<m; ++i)
if (m%i==0) nr+=2;
if (i*i==m) ++nr;
return nr;
}
int main()
{
int n, i, contor=0, num;
cout << "n="; cin >> n;
cout << "introdu " << n << " componente intregi \n";
for (i=1; i<=n; ++i)
cin >> v[i];
cout << "primele 3 componente cu nr de divizori >=3 \n";
for (i=1; i<=n; ++i)
{
if (nrdiv(v[i])>=3) { ++contor; cout << v[i] << " ";}
if (contor==3) break;
}
if (contor<3) cout << "NU EXISTA";
return 0;
}