let () =
	let arr = Array.make 4 0 in
	Scanf.scanf "%d\n" @@ fun n ->
    for i = 0 to n - 1 do
    	Scanf.scanf "%s\n" @@ fun s -> 
        if s = "AC" then arr.(0) <- arr.(0) + 1
        else if s = "WA" then arr.(1) <- arr.(1) + 1
        else if s = "TLE" then arr.(2) <- arr.(2) + 1
        else arr.(3) <- arr.(3) + 1
    done;
    Printf.printf "AC x %d\n" arr.(0);
    Printf.printf "WA x %d\n" arr.(1);
    Printf.printf "TLE x %d\n" arr.(2);
    Printf.printf "RE x %d\n" arr.(3);