from collections import Counter

input = raw_input

n = int(input())
words = [input() for i in range(n)]
c = Counter(words)

keys = c.keys()
res_keys = ["AC", "WA", "TLE", "RE"]
for key in res_keys:
    if key in keys:
        num = c[key]
    else:
        num = 0
    out_txt = "%s x %d" % (key, num)
    print(out_txt)