n = int(input())
c1=0
c2=0
c3=0
c4=0
for I in range(1, n):
    s = str(input())
    if(s == "AC"):
        c1+= 1
    elif(s == "WA"):
        c2+=1
    elif(s == "TLE"):
        c3+=1
    elif(s == "RE"):
        c4 +=1
print(f"AC x {c1}")
print(f"WA x {c2}")
print(f"TLE x {c3}")
print(f"RE x {c4}")

