#include<stdio.h>
#include<string.h>
int main()
{ int N,i,C0,C1,C2,C3;
 char S[100000];
 scanf("%d",&N);
 for(i=1;i<=N;i++)
 {
   scanf("%s",&S[i]);
 }
 for(i=1;i<=N;i++)
 {
   if(S[i]=='AC')
     C0 = C0+1;
   else if(S[i]=='WA')
     C1 = C1+1;
   else if(S[i]=='TLE')
     C2=C2+1;
   else 
     C3=C3+1;
 }
 printf("%d%d%d%d",'AC x'C0,'WA x'C1,'TLE x'C2,'RE x'C3);
   return 0;
}
 
