main=do
 getLine
 s<-lines<$>getContents
 putStr"AC x "
 print$length[1|t<-s,t=="AC"]
 putStr"WA x "
 print$length[1|t<-s,t=="WA"]
 putStr"TLE x "
 print$length[1|t<-s,t=="TLE"]
 putStr"RE x "
 print$length[1|t<-s,t=="RE"]