#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC")
      a++;
    else if (S == "WA")
      w++;
    else if (S == "TLE")
      t++;
    else if (S == "RE")
      r++;
  }
  cout << "AC * " << a << endl;
  cout << "WA * " << w << endl;
  cout << "TLE * " << t << endl;
  cout << "RE * " << r << endl;
}
