import java.util.*;
import java.lang.Math;
public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int counterAC = 0;
        int counterWA = 0;
        int counterTLE = 0;
        int counterRE = 0;
        for(int i = 0; i < N; i ++){
                    String S = sc.next();
                    if(S.equals("AC")){
                        counterAC++;
                    }else if(S.equals("WA")){
                        counterWA++;
                    }else if(S.equals("TLE")){
                        counterTLE++;
                    }else if(S.equals("RE")){
                        counterRE++;
                    }
            }
            System.out.println("AC x " + counterAC);
            System.out.println("WA x " + counterWA);
            System.out.println("TLE x " + counterTLE);
            System.out.println("RE x " + counterRE);
    }
}

/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