n = int(input())

dic = {}
dic["AC"] = 0
dic["WA"] = 0
dic["TLE"] = 0
dic["RE"] = 0

for e in range(n):
	entrada = input()
	if entrada == "AC":
		dic["AC"] += 1
	elif entrada == "WA":
		dic["WA"] += 1
	elif entrada == "TLE":
		dic["TLE"] += 1
	elif entrada == "AC":
		dic["RE"] += 1
		
print("AC x %d"% dic["AC"])
print("WA x %d"% dic["WA"])
print("TLE x %d"% dic["TLE"])
print("RE x %d"% dic["RE"])
