import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a=0;
        int b=0;
        int c=0;
        int d=0;
        for(int i=0; i<n; i++) {
            String s = sc.next();
            if(s.equals("AC")) a++;
            if(s.equals("WA")) b++;
            if(s.equals("TLE")) c++;
            if(s.equals("RE")) d++;
        }
        System.out.println("AC x " + a);
        System.out.println("WA x " + b);
        System.out.println("TLE x " + c);
        System.out.println("RE x " + d);

    }


}