import java.util.*;import static java.lang.System.*;class Main{public static void main(String[] a){Scanner s=new Scanner(System.in);int w=0;int x=0;int y=0;int z=0;for(int i=s.nextInt();i>0;i--){String b=s.next();if(b.equals("AC"))w++;if(b.equals("WA"))x++;if(b.equals("TLE"))y++;if(b.equals("RE"))z++;}out.println("AC x "+w);out.println("WA x "+x);out.println("TLE x "+y);out.println("RE x "+z);}}