#!perl -0n /\d/,print+($x="@{[('+'.'-'x(y/-///2/$').'+')x$']} ",$x=~y/+-/| /rx(y/|///2/$&),$x)x$&for/.*? \d+/gs