let n = read_int ()
let s = Array.init n (fun _ -> Scanf.scanf "%s\n" (fun s -> s)) 

let rec f i a w t r =
  if i = n then
    Printf.printf "AC x %d\nWA x %d\nTLE x %d\nRE x %d\n" a w t r
  else
    match s.(i).[0] with
      'A' -> f (i + 1) (a + 1) w t r
    | 'W' -> f (i + 1) a (w + 1) t r
    | 'T' -> f (i + 1) a w (t + 1) r
    |  _  -> f (i + 1) a w t (r + 1)

let () = f 0 0 0 0 0
