N = int(input())
s = [input() for i in range(N)]

res = {
    'AC' : 0,
    'TLE' : 0,
    'WA' : 0,
    'RE' : 0
}

for k in s:
    print(res[k])
    res[k] = res[k] + 1

for k, v in res.items():
    print(k + ' x ' + str(v))