#include <iostream>

using namespace std;

int main(){
	int n;
  	cin>>n;
  	int wac=0,rec=0,acc=0,tlec=0;
  	vector<string> verdict(n);
  	for(int i=0;i<n;i++){
    	cin>>verdict[i];
      	if(verdict[i] == "AC") acc++;
      	if(verdict[i] == "WA") wac++;
      	if(verdict[i] == "RE") rec++;
      	if(verdict[i] == "TLE") tlec++;
      
    }
  	cout<<"AC"<<" x "<<acc<<endl;
  	cout<<"WA"<<" x "<<wac<<endl;
  	cout<<"TLE"<<" x "<<tlec<<endl;
   	cout<<"RE"<<" x "<<rec<<endl;
  
  	return 0;
}