#include <stdio.h>
int ac = 0, wa = 0, tle = 0, re = 0, n;
char count[100];
int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%s", &count);
        if (count == 'AC') {
            ac = ac + 1;
        } else if (count == 'WA') {
            wa = wa + 1;
        } else if (count == 'TLE') {
            tle = tle + 1;
        } else {
            re = re + 1;
        }
    }
    printf("AC x %d\n", ac);
    printf("WA x %d\n", wa);
    printf("TLE x %d\n", tle);
    printf("RE x %d\n", re);
}