int main(int argc, char const *argv[])
{

    int N;
    scanf("%d", &N);

    unordered_map<string, int> cnt;
    for (int i = 0; i < N; i++) {
        string s;
        cin>>s;
        cnt[s]++;
    }

    cout<<"AC x "<<cnt["AC"]<<endl;
    cout<<"WA x "<<cnt["WA"]<<endl;
    cout<<"TLE x "<<cnt["TLE"]<<endl;
    cout<<"RE x "<<cnt["RE"]<<endl;

    return 0;
}