@p=<2 125 4 127 16 121 8 131 61 88 34 117>; $_=<>; while($_>0){ push@a,@p[($i,$i+1)x($==sqrt)]; $i+=2; $_-=$=*$=; } print@a."\n@a"