#include <stdio.h>
#include <string.h>
int main(void)
{
int n,a=0,b=0,c=0,d=0,i;
char s;
char *s1 = "AC";
char *s2 = "WA";
char *s3 = "TLE";
char *s4 = "RE;
scanf("%d",&n);
for(i=1;i<=n;i++){
  scanf("%s",&s);
  if(strcmp(s1,s) == 0)
    a++;
  else if(strcmp(s2,s) == 0)
    b++;
  else if(strcmp(s3,s) == 0)
    c++;
  else if(strcmp(s4,s) == 0)
    d++;
}
  printf("AC * %d",a);
  printf("WA * %d",b);
  printf("TLE * %d",c);
  printf("RE * %d",d);
  return 0;
}
