import sys
N = int(input())

dict = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}

for _ in range(N):
    S = input()
    if S in dict:
        i = dict.get(S)
        i += 1
        dict[S] = i

for key in dict.keys():
    print(key, '×', dict.get(key))