main = solve (0,0,0,0) <$> getLines >>= printAll

getLines = tail . lines <$> getContents

printAll (a, b, c, d) = do
    putStrLn $ "AC x "  ++ show a
    putStrLn $ "WA x "  ++ show b
    putStrLn $ "TLE x " ++ show c
    putStrLn $ "RE x "  ++ show d

solve x [] = x
solve (a,b,c,d) (e:l) = case e of
    "AC"  -> solve (a+1,b,c,d) l
    "WA"  -> solve (a,b+1,c,d) l
    "TLE" -> solve (a,b,c+1,d) l
    "RE"  -> solve (a,b,c,d+1) l
