N = gets.to_i
Ss = Array.new(N) { gets.chomp }


count_hash = hash = Hash.new
Ss.each do |item|
  case item
  when 'AC'
    count = count_hash['AC'] || 0
    count += 1
    count_hash['AC'] = count
  when 'WA'
    count = count_hash['WA'] || 0
    count += 1
    count_hash['WA'] = count
  when 'TLE'
    count = count_hash['TLE'] || 0
    count += 1
    count_hash['TLE'] = count
  when 'RE'
    count = count_hash['RE'] || 0
    count += 1
    count_hash['RE'] = count
  else
    raise "#{item}は無いエラー"
  end
end

puts "AC x #{count_hash['AC'] || 0}"
puts "WA x #{count_hash['WA'] || 0}"
puts "TLE x #{count_hash['TLE'] || 0}"
puts "RE x #{count_hash['RE'] || 0}"