ll@N,k,r,f[9],e[9],b[N+1]={};REP(i,N){REP(m,Factor(i+k=1,f,e))if(e[m]%2)k*=f[m];RREP(j,1,N/k+1)if(!b[k*j]&&j==(r=sqrt(j))*r){b[k*j]=1;wtSp(k*j);break;}}