input_n = input()
N = int(input_n)

check_list = ['AC', 'WA', 'TLE', 'RE']
count_list = [0, 0, 0, 0]

for i in range(N):
    flag = 0
    Si = input()
    while flag<4:
        if Si==check_list[flag]:
            count_list[flag] += 1
        else:
            flag += 1

print('AC  x  '+count_list[0])
print('WA  x  '+count_list[1])
print('TLE  x  '+count_list[2])
print('RE  x  '+count_list[3])