#include <iostream>

main()
{
  int n = 0;
  std::cin >> n;
  
  string as[] = new string[4]{"AC","WA","TLE","RE"};
  string ac[] = new int[4]{0,0,0,0};
  string s;
  for(auto i = 0; i< n; ++i)
  {
    std::cin >> s;
    
    for(auto j = 0; j < 4; ++j)
    {
      if(s == as[j])
      {
        ++ac[j];
        break;
      }
    }
  }
  
  for(auto j = 0; j < 4; ++j)
  {
    std::cout << as[j] << " x " << ac[j] << std::endl;
  }
}
