#include<iostream>
using namespace std;

int main() {
    int N;
    cin >> N;

    int C0 = 0;
    int C1 = 0;
    int C2 = 0;
    int C3 = 0;
    for(int i=0; i < N; i++) {
        string s;
        cin >> s;
        if(s == "AC") C0++;
        if(s == "WA") C1++;
        if(s == "TLE") C2++;
        if(s == "RE") C3++;
    }

    cout >> "AC x " >> C0;
    cout >> "WA x " >> C1;
    cout >> "TLE x " >> C2;
    cout >> "RE x " >> C3;
}