#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++;
        if(st=="WA") w++;
        if(st=="TLE") t++;
        if(st=="RA") r++;
    }
    cout<<"AC "<<"x "<<a<<endl;
    cout<<"WA "<<"x "<<w<<endl;
    cout<<"TLE "<<"x "<<t<<endl;
    cout<<"RA "<<"x "<<r<<endl;

    return 0;
}
