#include <stdio.h>
#include <string.h>

int main() {
	int n;
	scanf("%d", &n);
	int arr[4] = {};
	char x[4];
	for(int i = 0; i < n; i++){
		scanf("%s",x);
		if(s[0] == 'A'){
			x[0]++;
		}else if(s[0] == 'W'){
			x[1]++;
		}else if(s[0] == 'T'){
			x[2]++;
		}else if(s[0] == 'R'){
			x[3]++;
		}
	}
	printf("AC x %d\n", x[0]);
	printf("WA x %d\n", x[1]);
	printf("TLE x %d\n", x[2]);
	printf("RE x %d\n", x[3]);
	
	
	return 0;
}
