void main(){
	string[] judgest = ["AC", "WA", "TLE", "RE"];
	int n = _scan();
	int[4] judged;
	foreach(i; 0..n){
		switch( readln().chomp() ){
			case "AC": judged[0]++; break;
			case "WA": judged[1]++; break;
			case "TLE": judged[2]++; break;
			case "RE": judged[3]++; break;
			default: break;
		}
	}
	foreach(i, elm; judgest)writefln("%s x %d", elm, judged[i]);
}
import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}
