N = int(input())
X0,X1,X2,X3=0,0,0,0
for i in range(N):
    Si=input()
    if Si == 'AC':
        X0 = X0+1

    elif Si=='WA':
        X1=X1+1

    elif Si=='TLE':
        X2=X2+1
    
    else:
        X3=X3+1
 
print('AC x' +str(X0))
print('WA x' +str(X1))
print('TLE x'+str(X2))
print('RE x' +str(X3))