#include <stdio.h>

#define MAX_N 100000

int main(void) {
  int n;
  int ac = wa = tle = re = 0;
  int i;
  
  scanf("%d", &n);
  for (i=0; i<n; i++) {
    char *str;
    scanf("%s",str);
    switch(str[0]) {
      case 'a':ac++;break;
      case 'w':wa++;break;
      case 't':tle++;break;
      case 'r':re++;break;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",ac,wa,tle,re);
  return 0;
}