n=int(input())
ct=0
count=0
a=0
b=0

for i in range(1,n+1):
    s=input()
    if(s=="AC"):
        ct=ct+1
    elif(s=="WA"):
        count=count+1
    elif(s=="TLE"):
        a=a+1
    elif(s=="Re"):
        b=b+1
print("AC x",ct)
print("WA x",count)
print("TLE x",a)
print("RE x",b)


        
        
   

    
      
