import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String n = sc.nextLine();
		int ac=0,wa=0,tle=0,re=0;
		String =sc.next()
		for(int i=0;i<n;i++){
			switch (result){
			case "AC":
				C1 += 1;
				break;
			case "WA":
				C2 += 1;
				break;
			case "TLE":
				C3 += 1;
				break;
			case "RE":
				C4 += 1;
				break;
			default:
			}
			result = sc.next();
		}
		System.out.println("AC x "+ ac);
		System.out.println("WA x "+ wa);
		System.out.println("TLE x "+ tle);
		System.out.println("Re x "+ re);
	}
}