#include <iostream>
#include <cstring>
using namespace std;
int main()
{
    int N, a = 0, y = 0, z = 0, c = 0, i;
    cin >> N;
    string a[N];
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        if (a[i] == "AC")
            a = a + 1;
        if (a[i] == "WA")
            y = y + 1;
        if (a[i] == "TLE")
            z = z + 1;
        if (a[i] == "RE")
            c = c + 1;
    }
    cout << "AC x " << a << endl;
    cout << "WA x " << y << endl;
    cout << "TLE x " << z << endl;
    cout << "RE x " << c << endl;
    return 0;
}