
class Main{

public static void main (String[] args) {

	java.util.Scanner sc = new java.util.Scanner(System.in);

	int N = sc.nextInt();

	int kosuu [] = new int [4];

	for (int i=0; i<N; i++) {
		String temp = sc.next();
		if (temp.equals("AC")) {
			kosuu[0]++;
		} else if (temp.equals("WA")) {
			kosuu[1]++;
		} else if (temp.equals("TLE")) {
			kosuu[2]++;
		} else {
			kosuu[3]++;
		}
	}

	System.out.print("AC x ");
	System.out.println(kosuu[0]);
	System.out.print("WA x ");
	System.out.println(kosuu[1]);
	System.out.print("TLE x ");
	System.out.println(kosuu[2]);
	System.out.print("RE x ");
	System.out.println(kosuu[3]);

	sc.close();;

}


}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz