#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  int A = 0;
  int B = 0;
  int C = 0;
  int D = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      A = A + 1;
    }
    if (S == "WA") {
      B = B + 1;
    }
    if (S == "TLE") {
      C = C + 1;
    }
    if (S == "RE") {
      D = D + 1;
    }
  }
  cout << "AC" << A << endl;
  cout << "WA" << B << endl;
  cout << "TLE" << C << endl;
  cout << "RE" << D << endl;
}
