package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	m := map[string]int{"AC": 0, "WA": 0, "TLE": 0, "RE": 0}

	for i := 0; i < n; i++ {
		var ans string
		fmt.Scanf("%s", &ans)
		m[ans]++
	}
	for k, v := range m {
		fmt.Printf("%s x %d\n", k, v)
	}
}
