n = gets.to_i
ac = 0
wa = 0
tle = 0
re = 0

n.times do
  tmp = gets.chomp
  case tmp
  when "AC"
    ac += 1
  when "WA"
    wa += 1
  when "TLE"
    tle += 1
  else
    re += 1
  end
end

puts <<~EOS
       AC x #{ac}
       WA x #{wa}
       TLE x #{tle}
       RE x #{re}
     EOS
