import java.io.*;
import java.util.Scanner;
public class Main {
    private enum hoge{
        AC,
        WA,
        TLE,
        RE;
    }
    public static void main(String[] args) {
        InputStream in = System.in;
        Scanner scanner = new Scanner(in);

        int ac = 0;
        int wa = 0;
        int tle = 0;
        int re = 0;

        int next = scanner.nextInt();
        for (int i = 0; i <= next; i++) {
            String s = scanner.nextLine();
            if (s.equals(hoge.AC.toString())) {
                ac++;
            }else if(s.equals(hoge.WA.toString())){
                wa++;
            }else if(s.equals(hoge.TLE.toString())){
                tle++;
            }else if(s.equals(hoge.RE.toString())){
                re++;
            }
        }
        scanner.close();
        System.out.println( String.format("AC x %s", ac) );
        System.out.println( String.format("WA x %s", wa) );
        System.out.println( String.format("TLE x %s", tle) );
        System.out.println( String.format("RE x %s", 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