import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int N = Integer.parseInt(s.nextLine());
        String[] Sz = new String[N];
        for (int i = 0; i < N; i++){
            Sz[i] = s.nextLine();
        }
        HashMap<String,Integer> map = new HashMap<String,Integer>();
        for (int i = 0; i < N; i++){
            if (!map.keySet().contains(Sz[i])){
                map.put(Sz[i],1);
            } else {
                map.put(Sz[i],map.get(Sz[i]) + 1);
            }
        }
        if (map.get("AC") == null){
            System.out.println("AC x 0");
        } else {
            System.out.println("AC x "+map.get("AC"));
        }
        if (map.get("WA") == null){
            System.out.println("WA x 0");
        } else {
            System.out.println("WA x "+map.get("WA"));
        }
        if (map.get("TLE") == null){
            System.out.println("TLE x 0");
        } else {
            System.out.println("TLE x "+map.get("TLE"));
        }
        if (map.get("RE") == null){
            System.out.println("RE x 0");
        } else {
            System.out.println("RE x "+map.get("RE"));
        }
        
    }
}
/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