n = int(input())  # nは入力回数
str_list = [input() for _ in range(n)]


a=0
b=0
c=0                
d=0                
                
for num in range(1, n)
    if str_list[num] == 'AC':
                a += 1
    elif str_list[num] == 'WA':
                b += 1
    elif str_list[num] == 'TLE':
                c +=1
    else str_list[num] == 'RE':
                d +=1
    	continue;

print('AC x'+ a)
print('WA x'+ b)
print('TLE x'+ c)
print('RE x'+ d)
