#include<bits/stdc++.h>
using namespace std;
int main(){
  long long ac=0,wa=0,tle=0,re=0,n=0;
  cin>>n;
  string inp;
  for(int i=0;i<n;i++){
  cin>>inp;
    if(inp=="AC"){
      ac++;
    }
    if(inp=="WA"){
      wa++;
    }
    if(inp=="TLE"){
    tle++;
    }
    if(inp="RE"){
    re++;
    }
  }
  cout<<"AC x "<<ac<<"\n";
  cout<<"WA x "<<wa<<"\n";
  cout<<"TLE x "<<tle<<"\n";
  cout<<"RE x "<<re<<"\n";
  return 0;
}