#!perl -ln @a=!/ /;@a=($_%$',@a),$_/=$' while$_>1;print@a