i=input();d=o=9while~-d: n=i;d=o+1;o=i=0 while(n*d+i)**.5%1:i=-~i%d;d+=9*d*0**iprint'%d'%n**.5
1337
96
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!