$s=<>;
sub f{9-$i-$_[0]?$":pop}
for$i(0..8){
    $h=1;
    $_=$s;
    s!(\.*)(\d?)!
        $D=($w=length$1)+$h-($2||1);
        join'',(map{
            ($x=$_-int$D/2)<0
                ?f--$h,'\\'
                :$x
                    ?f++$h,'/'
                    :$D%2
                        ?f--$h,v
                        :f$h,'/'
        }0..$w-1),$2
            ?f$h=$2,'^'
            :''
    !ge;
    print if/\S/
}