defmodule Main do
  def main do
    n = IO.gets("") |> String.trim() |> String.to_integer()
    1..n
    |> Enum.reduce([], fn _, acc ->
      s = IO.gets("") |> String.trim()
      [s | acc]
    end)
    |> Enum.frequencies()
    |> print()
  end

  defp print(map) do
    ["AC", "WA", "TLE", "RE"]
    |> Enum.map(fn s ->
      "#{s} x #{Map.get(map, s, 0)}"
    end)
    |> Enum.each(&IO.puts/1)
  end
end
