#include<stdio.h>

void main()
{
    int n,ac=0,wa=0,tle=0,re=0;
    char a[3];
    scanf("%d",&n);
    while(n>=1)
    {
        scanf("%s",a);
        if(a=="AC")
            ac++;
        else if(a=="WA")
            wa++;
        else if(a=="TLE")
            tle++;
        else
            re++;
        n--;
    }
    printf("AC*%d\n",ac);
    printf("WE*%d\n",wa);
    printf("TLE*%d\n",tle);
    printf("RE*%d\n",re);
}
