N=int(input())
s=[]
cnt=[0 for i in range(4)]
for i in range(N):
    s.append(input())

for i in range(N):
    if s[i]=="AC":
        cnt[0]+=1
    elif s[i]=="WA":
        cnt[1]+=1
    elif s[i]=="TLE":
        cnt[2]+=1
    elif s[i]=="RE":
        cnt[3]+=1

print("AC x {}".format(cnt[0]))
print("WA x {}".format(cnt[1]))
print("TRE x {}".format(cnt[2]))
print("RE x {}".format(cnt[3]))