n = gets.to_i
s = []
rsl = [0,0,0,0]
rsllabel = ["AC","WA","TLE","RE"]
n.times do
  s << gets.chomp
end
s.size.times do |i|
  rsl[rsllabel.find_index(s[i])] += 1
end
rsl.size.times do |i|
  puts "#{rsllabel[i]} x #{rsl[i]}"
end