function main()
  
  N = parse(Int, readline())

  dict = Dict("AC" => 0, "WA" => 0, "TLE" => 0, "RE" => 0)
  
  for i in 1:N
    S = chomp(readline())
    dict[S] = get(dict, S, 0) + 1
  end
  
  for i in keys(dict)
    println(i, " x ", dict[i])
  end
  
end

main()