function main(input) {
  // 入力値の分離
  var tmp = input.split("\n");
  var AC = 0;
  var WA = 0;
  var TLE = 0;
  var RE = 0;

  for(var i = 1; i < tmp.length; i++){
    switch(tmp[i]){
      case "AC":
        AC++;
        break;
      case "WA":
        WA++
        break;
      case "TLE":
        TLE++
        break;
      case "RE":
        RE++
        break;
    }
  }

  var ans = ""
  ans += "AC x " + String(AC) + "\n"
  ans += "WA x " + String(WA) + "\n"
  ans += "TLE x " + String(TLE) + "\n"
  ans += "RE x " + String(RE) + "\n"

  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));parseInt