#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, a=0, w=0, t=0, r=0;
  	cin>>n;
  	string s[n];
  	for(int i=0; i<n; i++)
    {
    	cin>>s[i];
      	if(s[i]=='AC')
        {
          a++;
        }
      	else if if(s[i]=='WA')
        {
          w++;
        }
      	else if if(s[i]=='TLE')
        {
          t++;
        }
      	else if if(s[i]=='RE')
        {
          r++;
        }
    }
  	cout<<"AC x "<<a<<"\n";
  	cout<<"WA x "<<w<<"\n";
  	cout<<"TLE x "<<t<<"\n";
  	cout<<"RE x "<<r<<"\n";

}
