# #include <iostream>
#include <stdio.h>

using namespace std;
int main()
{
  int num,count1=0,count2=0,count3=0,count4=0;
  string temp;
  cin>> num;
  for(int i =0; i<num ; i++)
  {
    cin>>temp;
    if(temp =="AC"){
		count1 ++;
    }
    else if(temp =="WA")
    {
		count2 ++;
    }
    else if (temp =="TLE")
    {
      	count3++;
    }
    else 
      	count4 ++;
  }
  cout <<"AC x "<<count1<<endl;
  cout <<"WA x "<<count2<<endl;
  cout <<"TLE x "<<count3<<endl;
  cout <<"RE x "<<count4<<endl;
  return 0;
}