#! python3
# coding:utf-8

n = int(input())

s = [input() for _ in range(n)]
print(s)

c0=0
c1=0
c2=0
c3=0
for i in s:
    if i == "AC":
        c0+=1
    elif i == "WA":
        c1+=1
    elif i == "TLE":
        c2+=1
    else:
        c3+=1

print("AC x",c0)
print("WA x",c1)
print("TLE x",c2)
print("RE x",c3)
