n = gets.to_i
ac = 0
wa = 0
tle = 0
re = 0
n.times do |s|
  i = gets.chomp.to_s
  if i == "AC"
    ac+=1
  elsif i == "WA"
    wa+=1
  elsif i == "TLE"
    tle+=1
  elsif i == "RE"
    re+=1
  end
end

printf("AC x %d\n",ac)
printf("WA x %d\n",wa)
printf("TLE x %d\n",tle)
printf("RE x %d\n",re)