$n=<>*2;$\=3;$\=($_+=$_*$_-$n)?/-/&&sqrt(1-$_*4)!~/\./?2:$\:1for 1..4e3;print