map{++$ $'{<>}for@$_=//..<>;$\.=$t=/ /&&$/.5*$A{$q=$`.$/}*$B{$q}*$C{$q};$x+=$t*$'}A..C,map~~<>,0..4;print$x/@A/@B/@C