#include <bits/stdc++.h>

using namespace std;

int main(){
  int N, AC = 0, WA = 0, TLE = 0 , RE = 0;
  cin>>N;
  string c;
  for(int i=0; i<N; i++){
    cin>>c;
    switch(c){
      case "AC":
        AC++;
        break;
      case "WA":
        WA++;
        break;
      case "TLE":
        TLE++;
        break;
      case "RE":
        RE++;
        break;
    }
  }
  cout<<"AC x "<<AC<<"\n";
  cout<<"WA x "<<WA<<"\n";
  cout<<"TLE x "<<TLE<<"\n";
  cout<<"RE x "<<RE<<"\n";
  return 0;
}