#include <stdio.h>

int main(void){
  int i, n, s[4];
  char *a[3];
  
  scanf("%d", &n);
  for(i=0; i<n; i++){
    scanf("%s", a);
    switch((int)a[0]){
      case 'A':
        s[0]++;
        break;
      case 'W':
        s[1]++;
        break;
      case 'T':
        s[2]++;
        break;
      case 'R':
        s[3]++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", s[0], s[1], s[2], s[3]);
return 0;}
