#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int C0, C1, C2, C3;
  C0 = 0;
  C1 = 0;
  C2 = 0;
  C3 = 0;
  vector<string> answer(N);
  for (int i = 0; i < N; i++) {
    cin >> answer.at(i);
  }
  for (int i = 0; i < N; i++) {
    if (answer.at(i) == "AC") {
      C0++;
    } else if (answer.at(i) == "WA") {
      C1++;
    } else if (answer.at(i) == "TLE") {
      C2++;
    } else if (answer.at(i) == "RE") {
      C3++;
    } else {
    }
  }
  cout << "AC x" << C0 << endl;
  cout << "WA x" << C1 << endl;
  cout << "TLE x" << C2 << endl;
  cout << "RE x" << C3 << endl;
}
