#include <iostream>
using namespace std;


int main(){
	int n;
  	int ac=0, wa=0, tle=0, re=0;
  	string temp;
  	cin >> n;
  	for (int i=0;i<n;i++){
      cin >> temp;
      switch (temp){
        case "AC":
          ac++;
          break;
        case "WA":
          wa++;
          break;
        case "TLE":
          tle++;
          break;
        case "RE":
          re++;
      }
    }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
