line = gets
answers = Array.new(4,0)

while line = gets
    line = line.chomp
    if line == "AC"
        answers[0] += 1
        
    elsif line == "WA"
        answers[1] += 1
    elsif line == "TLE"
        answers[2] += 1
    else
        answers[3] += 1
    end
end

puts "AC x #{answers[0]}"
puts "WA x #{answers[1]}"  
puts "TLE x #{answers[2]}"  
puts "RE x #{answers[3]}"  