N = int(input())
X =[input() for i in range(N)] 

def p(X):
    print(X)

T = [X.count('AC'),X.count('WA'),X.count('TLE'),X.count('RE')]
T1 = ['AC', 'WA', 'TLE', 'RE' ]
p(T)

for j in range(4):
    print(T1[j] + ' x ' + str(T[j]))