n = gets.to_i

line = readlines.map(&:chomp)

h = line.group_by(&:itself).transform_values(&:size)

puts "AC x #{h["AC"]||= 0}"
puts "WA x #{h["WA"]||= 0}"
puts "TLE x #{h["TLE"]||= 0}"
puts "RE x #{h["RE"]||= 0}"