n=int(input())
a=w=r=t=0
for i in range(n):
    s=str(input())
    if s=="AC" :
        a+=1;
    elif s=="WA" :
        w+=1;
    elif s=="TLE":
        t+=1;
    else :
        r+=1;
    
print("AC * "+str(a) )
print("WA * "+str(w))
print("TLE * "+str(t))
print("RA * "+str(r))

