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