main = getContents >>= putStr.unlines.cnt.(\xs -> [map head xs, map (!!1) xs]).(map $(map eye).words).lines

cnt :: [[String]] -> [String]
cnt (x:y:_) = map unwords [[cntA x,cntA y], [cntB x,cntB y], [cntC x,cntC y], [cntD x,cntD y]]
  where cntA s = show.length $filter (=="A") s
        cntB s = show.length $filter (=="B") s
        cntC s = show.length $filter (=="C") s
        cntD s = show.length $filter (=="D") s

eye :: String -> String
eye n
  | n >= "1.1" = "A"
  | n >= "0.6" = "B"
  | n >= "0.2" = "C"
  | otherwise  = "D"