def count_data(s):
    judge_list = ['AC', 'WA', 'TEL', 'RE']
    for judge in judge_list:
        ans = s.count(judge)
        print('{} x {}'.format(judge, ans))

n = int(input())
s = []
for i in range(n):
    s.append(input())

count_data(s)