n = gets.to_i
table = {
    'AC'=> 0,
    'WA'=> 0,
    'TLE' => 0,
    'RE' => 0
}

n.times do
    judge = gets.chomp
    table.has_key?(judge) && table[judge]+=1
end

['AC','WA','TLE','RE'].each{|j|
    puts "#{j} x #{table[j]}"
}
