n = int(input())
ac, wa, tle, re = 0,0,0,0

for i in range(n):
    x = input()
    if x == 'AC':
        ac += 1
    elif x == 'WA':
        wa += 1
    elif x == 'TLE':
        tle += 1
    elif x == 're':
        re += 1

print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)