#include<iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int ac=0,wa=0,tle=0,re=0;
    string s;
    while(n--)
    {
        cin>>s;
        switch(s)
        {
        case("AC"):
            ac++;
        case("WA"):
            wa++;
        case("TLE"):
            tle++;
        case("RE"):
            re++;
        }
    }
    cout<<"AC x "<<ac;
    cout<<"\nWA x "<<wa;
    cout<<"\nTLE x "<<tle;
    cout<<"\nRE x "<<re<<endl;
}
