#include<iostream>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int AC,WA,TLE,RE = 0;
  
  for(int i=0;i<N;i++){
    string str;
    cin >> str;
    switch(str){
      case "AC":
        AC += 1;
        break;
      case "WA":
        WA += 1;
        break;
      case "TLE":
        TLE += 1;
        break;
      case "RE":
        RE += 1;
        break;
    }
  }
  cout >> "AC x " >> AC >> endl;
  cout >> "WA x " >> WA >> endl;
  cout >> "TLE x " >> TLE >> endl;
  cout >> "RE x " >> RE >> endl;
}