n = int(input())

d = {}

for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

for key, val in d.items():
    print(key, 'x', val)

if 'AC' not in d:
    print('AC x 0')
if ('WA' not in d):
    print('WA x 0')
if('TLE' not in d):
    print('TLE x 0')
if 'RE' not in d:
    print('RE x 0')
