#include <stdio.h>
int main(void) {
	int N, i,a=0,w=0,t=0,r=0;
	char Q, W, E, R,s[100001];
	scanf("%d", &N);
	Q = "AC";
	W = "WA";
	E = "TLE";
	R = "RE";
	for (i = 1; i <= N; i++) {
		scanf("%s",s[i]);
		if (strcmp(s[i],Q) ==0)
			a++;
		else if (strcmp(s[i], W) == 0)
			w++;
		else if (strcmp(s[i], E) == 0)
			t++;
		else if (strcmp(s[i], R) == 0)
			r++;
		
		
	}
	printf("AC x %d\n", a);
	printf("WA x %d\n", w);
	printf("TLE x %d\n", t);
	printf("RE x %d\n", r);




	return 0;
}