from collections import defaultdict

N = int(input())
d = defaultdict(int)
for _ in range(N):
    d[input()] += 1
for k in ['AC', 'WA', 'TLE', 'RE']:
    v = d[k]
    if v:
        print(f'{k} x {v}')