perl -E'$n=pop;say$x[@x]=$p=" "x($n-$_).(1x(2*$_-1)+$p*10)for 1..$n;say for@x[map-$_,2..@x]' 9