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

int main (void){
  int a;
  scanf("%d",&a);
  string s[a];
  for(int i=0;i<a;i++){
   scanf("%s",&s[i]);
 }
  int ac=0,wa=0,tle=0,re=0;
  for(int i=0;i<a;i++){
   if(s[i]=="AC")ac++;
   if(s[i]=="WA")wa++;
   if(s[i]=="TLE")tle++;
   if(s[i]=="RE")re++;
  }
  printf("AC x %d\n",ac);
  printf("WA x %d\n",wa);
  printf("TLE x %d\n",tle);
  printf("RE x %d\n",re);
  return 0;
}