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

int main()
{
   char str;
   char strr; 
  char st1,st2;
   long long a,b,c,d,i;
  a=0;
  b=0;
  c=0;
  d=0;
  memset(strrr, 0, sizeof(strrr));
  for(i==1;i<=100000;i++)
  {
   while(str=getchar() != '\n')
    {
        strcat(strr,str);
    }
        if(strr == st1)
        {
            break;
        }
        if(strr == "AC")
        {
            a++;
        }

        if(strr == "WA")
        {
            b++;
        }
      if(strr == "TLE")
        {
            c++;
        }
      if(strr == "RE")
        {
            d++;
        }
    fflush(stdin);
    memset(strr, 0, sizeof(strr));
    memset(str, 0, sizeof(str));
    memset(st1, 0, sizeof(st1));
    memset(st2, 0, sizeof(st2));
    st1=strr;
    st2=str;
    strcat(st1,st2);
  }
   
    printf("AC x %lld\n",a);
  printf("WA x %lld\n",b);
  printf("TLE x %lld\nl",c);
  printf("RE x %lld",d);
  
return 0;
}