#include <stdio.h>

int main(void) {
    int N, i, a = 0, w = 0, t = 0, r = 0;
    char s[4];
    scanf ("%d", &N);
    for (i = 0 ; i < N ; i++) {
        scanf ("%s", s);
        if (s[0] == 'A') a++;
        if (s[0] == 'W') w++;
        if (s[0] == 'T') t++;
        if (s[0] == 'R') r++;
    }
    printf ("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, w, t, r):
    return 0;
}