N=int(input())
box=[0]*4
for i in range(N):
    S=str(input())
    if S=="AC":
        box[0]+=1
    elif S=="WA":
        box[1]+=1
    elif S=="TLE":
        box[2]+=1
    else:
        box[3]*=1
print("AC x ",box[0])
print("WA x ",box[1])
print("TLE x ",box[2])
print("RE x ",box[3])
