#include <stdio.h>

int main()
{
    char s[100];
    int n, AC, WA, TLE, RE;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s", &s);
        if (strcmp(s, "AC") == 0)
        {
            AC += 1;
        }
        else if (strcmp(s, "WA") == 0)
        {
            WA += 1;
        }
        else if (strcmp(s, "TLE") == 0)
        {
            TLE += 1;
        }
        else
        {
            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);
    return 0;
}