#include <stdio.h>
#include <string.h>

void main (void)
{
  int index, ac, wa, tle, re, ret;
  index = ac = wa = tle = re = 0;
  char c[3];
  ret = scanf("%d", &index);
  if( ret == EOF ) {
    printf( "scanfでエラー\n" );
    return -1;
  }
  for (int i = 0; i < index; i++) {
    ret = scanf("%s", c);
    if( ret == EOF ) {
      printf( "scanfでエラー\n" );
      return -1;
    }
    if (strcmp(c, "AC")) {
      ++ac;
    } else if (strcmp(c, "WA")) {
      ++wa;
    } else if (strcmp(c, "TLE")) {
      ++tle;
    } else {
      ++re;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac, wa, tle, re);
  return;
}