#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
 int N;
 cin >> N;
 vector<string> S[i];
 int A,W,T,R;
 rep(m,N)
  cin >> S[i];
  if(S[N] == "AC"){
   A += 1;
  }else if(S[i] == "WA"){
   W += 1;
  }else if(S[i] == "TLE"){
   T += 1;
  }else if(S[i] == "RE"){
   R += 1;
 }
cout << "AC *" + A << endl;
cout << "WA *" + W << endl;
cout << "TLE *" + T << endl;
cout << "RE *" + R << endl;
}