#include <iostream>
 using namespace std;
 int main(){
   vector<string>A
  int N;
  int a,b,c,d = 0;
  cin >> N;
  vector<string>A(N);
  for (int i = 0; i < N; i++){
   cin >> A.at(i);
    if(A.at(i) == AC)
      a++;
     else if(A.at(i) == WA)
      b++;
     else if(A.at(i) == TLE)
      c++;
    else  if(A.at(i) == RE)
      d++;
  }
  cout << AC x a << endl;
  cout << WA x b << endl;
  cout << TLE x c << endl;
  cout << RE x d << endl;
}
