$a+=print s/./ ${[_ x$&._,"|".$"x~-$&."|",$"x$&.$"]}[$&+$a<=>9]/gr,$/for(<>)x10