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