S=input()
S=int(S)
a = [input() for i in range(S)]
AC=0
WA=0
TLE=0
RE=0
print(a)
for a in a:
    if a=="AC":
        AC+=1
    if a=="WA":
        WA+=1
    if a=="TLE":
        TLE+=1
    if a=="RE":
        RE+=1
print("AC x "+str(AC) )
print("WA x "+str(WA))
print("TLE x "+str(TLE))
print("RE x "+str(RE))