#include <iostream>
using namespace std;
map<string,int> mm;
int main() {
	// your code goes here
	int n;
	scanf("%d",&n);
	for(int e=0;e<n;e++) {
		string r;
		cin >> r;
		mm[r]++;
	}
	printf("AC x %d\n",mm["AC"]);
	printf("WA x %d\n",mm["WA"]);
	printf("TLE x %d\n",mm["TLE"]);
	printf("RE x %d\n",mm["RE"]);
	return 0;
}