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