N = input()

N = N.split(',')

AC_num = 0
WA_num = 0
TLE_num = 0
RE_num = 0


N_num = int(N[0])

for i in range(N_num):
    print(i+1)
    
    if 'AC' == N[i+1]:
        AC_num =+ 1
    
    elif 'WA' == N[i+1]:
        WA_num =+ 1

    elif 'TLE' == N[i+1]:
        TLE_num =+ 1
    
    elif 'RE' == N[i+1]:
        RE_num =+ 1
        
    else:
        print('nun')

print('AC','x',AC_num)
print('WA','x',WA_num)
print('TLE','x',TLE_num)
print('RE','x',RE_num)