#include <stdio.h>

int main(){
    int n;
    scanf("%d", &n);
    char s[10000000][5];
    int ac = 0, wa = 0, tle = 0, re = 0;
    for(int i = 0; i<n; i++){
        scanf("%s", &s[1000000][5]);
        if(s[i][5] = "AC"){ac++;}
        else if(s[i][5] = "WA"){wa++;}
        else if(s[i][5] = "TLE"){tle++;}
        else {re++;}
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac, wa, tle, re);
    return 0;
}