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