#include <iostream>
#include <string.h>
using namespace std;
int main(void){
	int N;
	cin >> N;
	int c1=0;
	int c2=0;
	int c3=0;
	int c4=0;
	for(int i=0; i<N;i++){
		char s[256];
		cin >> s;
		if(!strcmp(s,"AC")){
			c1++;
		}else if(!strcmp(s,"WA")){
			c2++;
		}else if(!strcmp(s,"TLE")){
			c3++;
		}else if(!strcmp(s,"RE")){
			c4++;
		}
		
	}
	
	cout << "AC x " << c1 <<endl;
	cout << "WA x " << c2 <<endl;
	cout << "TLE x " << c3 <<endl;
	cout << "RE x " << c4 <<endl;
	
	return 0;
 
}
#include <iostream>
#include <string.h>
using namespace std;
int main(void){
	int N;
	cin >> N;
	int c1=0;
	int c2=0;
	int c3=0;
	int c4=0;
	for(int i=0; i<N;i++){
		char s[256];
		cin >> s;
		if(!strcmp(s,"AC")){
			c1++;
		}else if(!strcmp(s,"WA")){
			c2++;
		}else if(!strcmp(s,"TLE")){
			c3++;
		}else if(!strcmp(s,"RE")){
			c4++;
		}
		
	}
	
	cout << "AC x " << c1 <<endl;
	cout << "WA x " << c2 <<endl;
	cout << "TLE x " << c3 <<endl;
	cout << "RE x " << c4 <<endl;
	
	return 0;

}