i = gets.to_i
arr = []

i.times do |i|
  arr[i].push = gets.chomp
end

puts ('AC x' + arr.count('AC'))
puts ('WA x' + arr.count('WA'))
puts ('TLE x' + arr.count('TLE'))
puts ('RE x' + arr.count('Re'))