n=int(input())
a,b,c,d=0,0,0,0
for i in range(n):
    s=input()
    if s=='AC':
        a=a+1
    elif s=='WA':
        b=b+1
    elif s=='TLE':
        c=c+1
    else:
        d=d+1
print('AC','X',a)
print('WA','X',b)
print('TLE','X',c)
print('RE','X',d)
