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