function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  input.shift();
  var S = input;
  S.splice(N,S.length);
  var a=0;
  var b=0;
  var c=0;
  var d=0;
  for(var i =0;i<N;i++){
    if(S[i]=="AC"){
      a++;
    }else if(S[i]=="WA"){
      b++;
    }else if(S[i]=="TLE"){
      c++;
    }else{
      d++;
    }
  }
  var ans = "AC x " + a + "\nWA x " + b + "\nTLE x " + c + "\nRE x " + d;

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));