# -*- coding: utf-8 -*-

N = int(input())

S = []
for i in range(N):
    S.append(input())

count_map = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}

for s in S:
    count_map[s] += 1
    print(count_map)

for count_key, count in count_map.items():
    print(count_key + " x " + str(count))
