import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] array = new String[n];

		int account = 0;
		int wacount = 0;
		int tlecount = 0;
		int recount = 0;

		for(int i=0;i<array.length;i++) {
			array[i] = scan.next();
			if(array[i].equals("AC")) {
				account = account + 1;
			}else if(array[i].equals("WA")) {
				wacount = wacount + 1;
			}else if(array[i].equals("TLE")) {
				tlecount = tlecount + 1;
			}else if(array[i].equals("RE")) {
				recount = recount + 1;
			}
		}

		System.out.println("AC x "+account);
		System.out.println("WA x "+wacount);
		System.out.println("TLE x "+tlecount);
		System.out.println("RE x "+recount);

	}

}
/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