let N = Int(readLine()!)!

var counter = [String: Int]()
for _ in 1...N {
	let si = readLine()!
	counter[si, default: 0] += 1
}

for k in ["AC", "WA", "TLE", "RE"] {
	print("\(k) x \(counter[k, default: 0])")
}
