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 Si=='RE':
      x3=x3+1
 
print('AC x' str(x0))
print('WA x' str(x1))
print('TLE x' str(x2))
print('RE x' str(x3))