N = gets.to_i
ac, wa, tle, re = 0, 0, 0, 0
N.times do
    s = gets.chomp
    if s == "AC"
        ac += 1
    elsif s == "WA"
        wa += 1
    elsif s == "TLE"
        tle += 1
    else
        re += 1
    end
end

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