#include <stdio.h>
int main(){
  int N,i;
  char S[10000000][3];
  int C[4]={0,0,0,0};
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",S[i]);
    if(S[i]=='AC'){
      C[0]++;}
    if(S[i]=='WA'){
      C[1]++;}
    if(S[i]=='TLE'){
      C[2]++;}
    if(S[i]=='RE'){
      C[3]++;}
  }
  printf("ACx%d",C[0]);
  printf("WAx%d",C[1]);
  printf("TLEx%d",C[2]);
  printf("REx%d",C[3]);
  return 0;
}