n = int(input())

d = {}
lst = ['AC', 'WA', 'TLE', 'RE']
for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

for key, val in d.items():
    if key in lst:
        print(key, 'x', val)
        lst.remove(key)
for i in lst:
    print(i, 'x 0')
