n = gets.to_i
ary = []
n.times { ary << gets.chomp }
cnt = ary.each_with_object(Hash.new(0)) {|e, h| h[e] += 1 }
puts "AC x #{cnt['AC'].to_i}\nWA x #{cnt['WA'].to_i}\nTLE x #{cnt['TLE'].to_i}\nRE x #{cnt['RE'].to_i}"


package main
 
import (
	"fmt"
)
 
func main() {
  var n int
  fmt.Scan(&n)
  
  results := make([]string, n)
  for i := 0; i < n; i++ {
    fmt.Scan(&results[i])
  }
  
  f0 := func(x string) bool { return (x == "AC") }
  f1 := func(x string) bool { return (x == "WA") }
  f2 := func(x string) bool { return (x == "TLE") }
  f3 := func(x string) bool { return (x == "RE") }
  
  fmt.Sprintf("AC x %d\nWA x %d\nTLE x %d\nLE x %d", cnt(f0, results), cnt(f1, results), cnt(f2, results), cnt(f3, results))
}
