using System;
using System.Text;
 
class Program {
  static void Main() {
    int acCount = 0,
        waCount = 0,
        tleCount = 0,
        reCount = 0;
    
    int caseCount = Console.ReadLine();
    for(int i = 0; i < caseCount; i++) {
      string errorType = Console.ReadLine();
      switch(errorType) {
         case "AC":
          acCount++;
          break;
         case "WA":
          waCount++;
          break;
         case "TLE":
          tleCount++;
          break;
         case "RE":
          reCount++;
          break;
      }
    }
    
    StringBuilder result = new StringBuilder();
    result.AppedLine($"AC x {acCount}")
      AppedLine($"WA x {waCount}").
      AppedLine($"TLE x {tleCount}").
      AppedLine($"RE x {reCount}");
    Console.WriteLine
  }
}