N = int(input())
Si = [input for i in range(N)]

C0 = 0
C1 = 0
C2 = 0
C3 = 0

for in1 in Si:
    if in1 == "AC":
        C0 +=1
    elif in1 == "WA":
        C1 += 1
    elif in1 == "TLE":
        C2 += 1
    elif in1 == "RE":
        C3 += 1

print("AC x {}".format(C0)) 
print("WA x {}".format(C1)) 
print("TLE x {}".format(C2)) 
print("RE x {}".format(C3)) 
