#include <bits/stdc++.h>


int main()
{
  int n;
  std::cin >> n;
  enum JUDGE
  {
    AC = 0,
    WA,
    TLE,
    RE,
    COUNT
  };
  std::vector<int> sums(4, 0);
  for (int i = 0; i < n; ++i)
  {
    std::string s;
    std::cin >> s;

    if (s == std::string("AC"))
    {
      sums[AC]++;
    }
    else if (s == std::string("WA"))
    {
      sums[WA]++;
    }
    else if (s == std::string("TLE"))
    {
      sums[TLE]++;
    }
    else if (s == std::string("RE"))
    {
      sums[RE]++;
    }
  }
  std::cout << "AC x " << sums[JUDGE::AC] << std::endl;
  std::cout << "WA x " << sums[JUDGE::WA] << std::endl;
  std::cout << "TLE x " << sums[JUDGE::TLE] << std::endl;
  std::cout << "RE x " << sums[JUDGE::RE] << std::endl;
  
  return 0;