n = gets.to_i
i = 0
s = []

while i < n
  s << gets.to_s
  i += 1
end

s = s.join
ac = s.scan("AC").length
wa = s.scan("WA").length
tle = s.scan("TLE").length
re = s.scan("RE").length

puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"
