defmodule Main do
def main do
  n = IO.gets("") |> String.trim() |> String.to_integer()
  IO.stream(:stdio, :line) 
  |> Enum.take(n)
  |> Enum.map(&String.trim(&1)) 
  |> Enum.frequencies()
  |> solve()
  end
  
  def solve(ans) do
    "AC x " <> (Map.get(ans, "AC", 0) |> Integer.to_string()) |> IO.puts()
    "WA x " <> (Map.get(ans, "WA", 0) |> Integer.to_string()) |> IO.puts()
    "TLE x " <> (Map.get(ans, "TLE", 0) |> Integer.to_string()) |> IO.puts()
    "RE x " <> (Map.get(ans, "RE", 0) |> Integer.to_string()) |> IO.puts()
  end
end