# Your code here!

n = gets.to_i
judges = readlines
c_0 = 0
c_1 = 0
c_2 = 0
c_3 = 0

judges.each do |judge| 
    if judge.start_with?("AC")
        c_0 += 1
    elsif judge.start_with?("WA")
        c_1 += 1
    elsif judge.start_with?("TLE")
        c_2 += 1
    elsif judge.start_with?("RE")
        c_3 += 1
    end
end
puts "AC x #{c_0}"
puts "WA x #{c_1}"
puts "TLE x #{c_2}"
puts "RE x #{c_3}"