N = gets.to_i
judges = {AC: 0, WA: 0, TLE: 0, RE: 0}
N.times { 
  judges[gets.chomp.to_sym] += 1
}

# (judges.group_by(&:itself).map { |key, value| [key, value.count] }.to_h).each { |key, value| puts "#{key} x #{value}" }

judges.each { |key, value| puts "#{key} x #{value}"}
