N = int(input())
List = [str(input()) for i in range(N)]
c0=0
c1=0
c2=0
c3=0
for i in List:
    if i=='AC':
        c0+=1
    elif i=='WA':
        c1+=1
    elif i=='TLE':
        c2+=1
    elif i=='RE':
        c3+=1
print('AC × {}'.format(c0))
print('WA × {}'.format(c1))
print('TLE × {}'.format(c2))
print('RE × {}'.format(c3))