n=gets.to_i
ss=n.times.map{gets.chomp.to_s}
ac,wa,tle,re=0,0,0,0
ss.each do |s|
  if s=="AC"
    ac+=1
  elsif s=="WA"
    wa+=1
  elsif s=="TLE"
    tle+=1
  elsif s=="RE"
    re+=1
  end
end
puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"