N = int(input())
str_list = [str(input()) for _ in range(N)]
count_ac = 0
count_wa = 0
count_tle = 0
count_re = 0

for s in str_list:
    if s == 'AC':
        count_ac = count_ac + 1
    elif s == 'WA':
        count_wa = count_wa + 1
    elif s == 'TLE':
        count_tle = count_tle + 1
    elif s == 'RE':
        coun_re == count_re + 1

print('AC x ' + str(count_ac))
print('WA x ' + str(count_wa))
print('TLE x ' + str(count_tle))
print('RE x ' + str(count_re))
