#include <iostream>
#include <string>
using namespace std;
int main(){
  string ac="AC";
  string wa="WA";
  string tle="TLE";
  string re="RE";
  string input;
  int n;
  cin >> n;
  int array[4];
  for(int i=0;i<4;++i){
    array[i]=0;
  }
  for(int i=0;i<n;++i){
    cin >> input;
    if(input==ac){
      array[0]++;
    }
    else if(input == wa){
      array[1]++;
    }
    else if(input == tle){
      array[2]++;
    }
    else if(input == re){
      array[3]++
    }
  }
  cout << "AC x " << array[0] << endl;
  cout << "WA x " << array[1] << endl;
  cout << "TLE x " << array[2] << endl;
  cout << "RE x " << array[3] << endl;
  return 0;
}