#include <iostream>
#include <string>


using namespace std;
void main() {
  string str;
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n; 
  while (--n != 0) {
  	cin >> str;
    switch (str):
    case "AC":
      ac++;
    case "WA":
      wa++;
    case "TLE":
      tle++;
    case "RE":
      re++;
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
}
