#include <iostream>
#include <string.h>
using namespace std;

int main()
{
  int N ;
  cin >> N ;
  string str[i] ;
  for(int i = 0;i < N;i++)
  {
    cin >> str[N];
  }
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  for(int i = 0;i < N;i++)
  {
    if(str[i] == "AC" )
    {
      AC++;
    }
    if(str[i] == "WA" )
    {
      WA++;
    }
     if(str[i] == "TLE" )
    {
      TLE++;
    }
       if(str[i] == "RE" )
    {
      RE++;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
  return 0;
}
