
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;



int main()
{
    ll n;
    cin>>n;
    ll wa=0,ac=0,tle=0,re=0;
    vector<
    for(ll i=0;i<n;i++)
    {
        string s;
        cin>>s;
        if(s=="RE")
            re++;
        else if(s=="AC")
            ac++;
        else if(s=="TLE")
            tle++;
        else if(s=="WA")
            wa++;
        
    }
   cout<<"AC x "<<ac<<endl;
   cout<<"WA x "<<wa<<endl;
   cout<<"TLE x "<<tle<<endl;
   cout<<"RE x "<<re<<endl;
   
    	return 0;
}

