#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  int v=0;
  int w=0;
  int x=0;
  int y=0;
  for(int i; i<N; i++){
    string s;
    cin>>s;
    if (s="AC"){
      v++;
    }
    if (s="WA"){
      w++;
    }
    if (s="TLE"){
      x++;
    }
    if (s="RE"){
      y++;
    }
  }
   cout<<"AC"<<" x "<<v<<endl;
   cout<<"WA"<<" x "<<w<<endl;
   cout<<"TLE"<<" x "<<x<<endl;
   cout<<"RE"<<" x "<<y<<endl;
   return 0;
}
    
    