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