#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<string> vec(n);
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for(int i = 0; i < n; i++) cin vec.at(i);
  for(int i = 0; i < vec.size(); i++){
    if(vec.at(i) == "AC") ac++;
    if(vec.at(i) == "WA") wa++;
    if(vec.at(i) == "TLE") tle++;
    if(vec.at(i) == "RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}