#include <stdio.h>

int main(void)
{
	char* mozi;
  int N;
  int AC=0,WA=0,TLE=0,RE=0;
  for(int i=0;i<N;i++){
  	switch(scanf("%s",mozi)){
      case 'AC':
        AC++;
        break;
      case 'WA':
        WA++;
        break;
      case 'TLE':
        THL++;
        break;
      case 'RE'
    	RE++;
        break;
    }
  }
  printf("ACx%d\nWAx%d\nTHLx%d\nREx%d",AC,WA,THL,RE);
  return 0;
}