from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
from bisect import bisect,bisect_right,bisect_left

def get_int():
    return int(stdin.readline().strip())


def get_tuple():
    return map(int, stdin.readline().split())


def get_list():
    return list(map(int, stdin.readline().split()))

n = get_int()
dic = defaultdict(int)
for _ in range(n):
    st = input()
    dic[st] += 1
for val in ['AC','WA','TLE','RE']:
    print(val+" * "+str(dic[val]))