import sys

N = input()


N = N.splitlines()


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


N_num = int(N[0])

if N_num < 1 or N_num > 100000:
    print('error')
    sys.exit()


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

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

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