n = gets.to_i
s = n.times.map { gets.chomp }

result = {
  'AC' => 0,
  'WA' => 0,
  'TLE' => 0,
  'RE' => 0
}

s.each do |si|
  result[si] += 1
end

[ 'AC', 'WA', 'TLE', 'RE' ].each do |k|
  puts "#{k} x #{result[k]}"
end

