let n = Int(readLine()!)!
var dic: Dictionary<String, Int> = [:]
for _ in 1...n {
	let key = readLine()!
	dic[key, default: 0] += 1
}
let keys = ["AC", "WA", "TLE", "RE"]
for k in keys {
	var s = k
	s.append(" x ")
	s.append(String(dic[k, default: 0]))
	print(s)
}
