perl -le'sub r{join"",map{int rand 10}1..$_[0]}$C=r($l=shift);while($t!=$C){print"$t";($r)="$t-$C"=~/^(.*).*-\1/;$t=$r.r($l-length$r)}print"$t"' 10