#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll t;
  cin>>t;
  ll ac=0,wa=0,tle=0,re=0;
  while(t--){
    ll string s;
    cin>>s;
    if(s=="AC"){
      ac++;
    }else if(s=="WA"){
      wa++;
    }else if(s=="TLE"){
      tle++;
    }else if(s=="RE"){
      re++;
    }
  
  }
  cout<<"AC X "<<ac<<endl;
  cout<<"WA X "<<wa<<endl;
  cout<<"TLE X "<<tle<<endl;
  cout<<"RE X "<<re<<endl;

}