n = int(input())
sa = [0]*n
for i in range(n):
    sa[i]= str(input())
a = 0
w =0
t=0
r=0

for s in sa:
    if s == "AC":
        a+=1
    if s == "WA":
        w+=1
    if s == "TLE":
        t+=1
    if s == "RE":
        r+=1

print("AC x "+str(a))
print("WA x "+str(w))
print("TLE x "+str(t))
print("RE x "+str(r))
