#!/usr/bin/env ruby
n = gets.chomp.to_i

hash = Hash.new(0)

hash['AC'] = 0
hash['WA'] = 0
hash['TLE'] = 0
hash['RE'] = 0

n.times do
  s_i = gets.chomp
  hash[s_i] += 1
end

puts "AC x #{hash['AC']}"
puts "WA x #{hash['WA']}"
puts "TLE x #{hash['TLE']}"
puts "RE x #{hash['RE']}"

