N = gets.to_i

Ary = readlines.map(&:chomp!)

map = { "AC" => 0, "WA" => 0, "TLE" => 0, "RE" => 0 }
Ary.each do |re|
  map[re] += 1
end

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