defmodule Main do
  def main do
    n = IO.gets("") |> String.trim() |> String.to_integer()
    1..n
    |> Enum.reduce(%{"AC" => 0, "WA" => 0, "TLE" => 0, "RE" => 0}, fn _, acc ->
      s = IO.gets("") |> String.trim()
      Map.update(acc, s, 1, & &1 + 1)
    end)
    |> print()
  end

  defp print(%{"AC" => ac, "WA" => wa, "TLE" => tle, "RE" => re}) do
    IO.puts "AC x #{ac}"
    IO.puts "WA x #{wa}"
    IO.puts "TLE x #{tle}"
    IO.puts "RE x #{re}"
  end
end