for(1..<>){ ($a,$b)=<>=~/\d+/g; $z=0; ++$z while($_=$a**$b/10**$z)>=10; $x=$_|0; $y=10*($_-$x)|0; print"$x $y $z\n"; }