n = gets.chomp.to_i
list = []
n.times do
  list << gets.chomp
end
ac = list.count("AC")
wa = list.count("WA")
tle = list.count("TLE")
re = list.count("RE")
puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"
