#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

enum judge{
    AC,
    WA,
    TLE,
    RE
};

int main(){
    int i;
    int n;
    char s[100001];
    int ac, wa, tle, re;
    ac = wa = tle = re = 0;

    scanf("%d", &n);
    for(i = 0;i < n;i++) scanf("%s", &s[i]);

    for(i = 0;i < n;i++){
        enum judge je;
        je = s[i];
        switch(s[i]){
            case AC:
                ac++;
                break;
            case WA:
                wa++;
                break;
            case TLE:
                tle++;
                break;
            case RE:
                re++;
                break;
        }
    }

    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",ac, wa, tle, re);

    return 0;
}