#include<iostream>
#include<string>
using namespace std;
int main(void)
{
  int N;
  cin>>N;
  string inp;
  int AC,WA,TLE,RE;
  for(int i=0;i<n;i++)
  {
    cin>>inp;
    if((inp.compare("AC"))
       {
      	AC++;
       }  
    if((inp.compare("WA"))
       {
       WA++;
       } 
    if((inp.compare("TLE")){
      TLE++;}
    if((inp.compare("RE")){
      RE++;}
  }
  
  cout<<"AC x "<<AC<<endl;
  cout<<"WA x "<<WA<<endl;
  cout<<"TLE x "<<TLE<<endl;
  cout<<"RE x "<<RE<<endl;
    
}
