a = []
b = 0
c = 0
d = 0
e = 0
i = 0
n = int(input())
for i in range(n):
	str = input()
    a.append(str)
    if a[i] == "AC":
    	b = b + 1
	else if a[i] == "WA":
    	c = c + 1
    else if a[i] == "TLE":
    	d = d + 1
    else if a[i] == "RE":
      	e = e + 1
print("AC x" b)
print("WA x" c)
print("TLE x" d)
print("RE x" e)