#include<iostream>
using namespace std;

int main(){
  int n;
  string s;
  vector<int> count(4,0);
  cin>>n;
  for(int i=0<n;i++){
    cin>>s;
    if(s=="AC")
      count[0]++;
    else if(s=="WA")
      count[1]++;
    else if(s=="TLE")
      count[2]++;
    else if(s=="RE")
      count[3]++;
  }
  cout<<"AC x "<<count[0]<<endl;
   cout<<"WA x "<<count[1]<<endl;
   cout<<"TLE x "<<count[2]<<endl;
   cout<<"RE x "<<count[3]<<endl;
  return 0;
}