a=int(input())
b=0
d=0
e=0
f=0
g=0
while b<a:
    c=input()
    if c=='AC':
        d=d+1
    if c=='WA':
        e=e+1
    if c=='TLE':
        f=f+1
    if c=='RE':
        g=g+1
    b=b+1
print('AC','x',d)
print('WA','x',e)
print('TLE','x',f)
print('RE','x',f)

