$_=1x($l=pop);for$i(0..$l-1){($_=reverse)++for substr$_,$i;s/(.{$l}).+/$1/;print"\r$_";1e-5