N=int(input())
S=list(map(input().split()))
A=0
B=0
C=0
D=0
for i in range(0,N):
    i=i+0
    if S[i]=="AC":
        A+=1
    elif S[i]=="WA":
        B+=1
    elif S[i]=="TLE":
        C+=1
    else:
        D+=1
        
print("AC x "+A)
print("WA x "+B)
print("TLE x "+C)
print("RE x "+D)