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