n = gets.to_i
s = Array.new(n) {gets.chomp}
ac_cnt = s.count("AC")
wa_cnt = s.count("WA")
tle_cnt = s.count("TLE")
re_cnt = s.count("RE")

puts "AC x #{ac_cnt}"
puts "WA x #{wa_cnt}"
puts "TLE x #{tle_cnt}"
puts "RE x #{re_cnt}"