#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
       cin.ignore();
    int a=0,w=0,t=0,r=0;
    while(n--)
    {
        string st;
        getline(cin,st);
        if(st=="AC") a++;
        //else if(t=="AC") a++;
        else if(st=="WA") w++;
        else if(st=="TLE") t++;
        else(st=="RA") r++;
    }
    cout<<"AC "<<"x"<<" "<<a<<endl<<"WA"<<" "<<"x"<<" "<<w<<endl<<"TLE "<<"x"<<" "<<t<<endl<<"RA"<<" "<<"x "<<r<<endl;

    return 0;
}
