package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	var ac, wa, tle, re int
	for i := 0; i < n; i++ {
		var tmp string
		fmt.Scanf("%s", &tmp)
		switch (tmp) {
		case "AC":
			ac++
		case "WA":
			wa++
		case "TLE":
			tle++
		case "re":
			re++
		}
	}

	fmt.Printf("AC x %d\n", ac);
	fmt.Printf("WA x %d\n", wa);
	fmt.Printf("TLE x %d\n", tle);
	fmt.Printf("RE x %d\n", re);
}
