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