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);}}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz