N = gets.to_i
hantei = readlines.map(&:chomp)  #これで改行コードを落とせている
a=0
b=0
c=0
d=0

(0..N-1).each do |x|
  if hantei[x] == "AC" then
    a += 1
  elsif hantei[x] == "WA" then
    b += 1
  elsif hantei[x] == "TLE" then
    c += 1
  else
    d += 1
  end
end
puts "AC x " + a.to_s
puts "WA x " + b.to_s
puts "TLE x " + c.to_s
puts "RE x " + d.to_s