N = int(input())
lis = [0,0,0,0]
for i in range(N):
    s = input()
    if s == 'AC':
        lis[0] += 1
    elif s == 'WA':
        lis[1] += 1
    elif s == 'TLE':
        lis[2] += 1
    else:
        lis[3] += 1
print('AC × '+str(lis[0]))
print('WA × '+str(lis[1]))
print('TLE × '+str(lis[2]))
print('RE × '+str(lis[3]))