from collections import Counter
n = int(input())
s = [input() for i in range(n)]

c = Counter(s)

for k in ['AC', 'WA', 'TLE', 'RE']:
    if k in c:
        print('{k} x {}'.format(k, c[k]))
    else:
        print('{} x {}'.format(k, c[k]))