#include <stdio.h>

int main(void)
{

  char buf[10];
  int x;

  char ans[10];
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;

  char ac[10] = "AC";
  char wa[10] = "WA";
  char tle[10] = "TLE";
  char re[10] = "RE";

  fgets(buf, sizeof(buf), stdin);
  sscanf(buf, "%d", &x);

  for(int i = 0; i < x; i++){
    fgets(buf, sizeof(buf), stdin);
    sscanf(buf, "%s", ans);

    if(ans[0] == 'A'){
      a++;
    } else if (ans[0] == 'W'){
      b++;
    } else if (ans == 'T'){
      c++;
    } else if (ans == 'R'){
      d++;
    }

  }

  printf("AC x %d\n", a);
  printf("WA x %d\n", b);
  printf("TLE x %d\n", c);
  printf("RE x %d\n", d);


}