n = int(input())
a, b, c, d = 0, 0, 0, 0
for i in range(n):
    s = input()
    if s == 'AC': a -= -1
    if s == 'WA': b -= -1
    if s == 'TLE': c -= -1
    if s == 'RE': d -= -1
print('AC *', a)
print('WA *', b)
print('TLE *', c)
print('RE *', d)