#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int A = 0;
  int W = 0;
  int T = 0;
  int R = 0;
  for (int j = 0; j > N; j++) {
    if (vec.at(j) == "AC") {
      A++;
    } else if (vec.at(j) == "WA") {
      W++;
    } else if (vec.at(j) == "TLE") {
      T++;
    } else if (vec.at(j) == "RE") {
      R++;
    }
  }
  cout << "AC x " << A << endl;
  cout << "WA x " << W << endl;
  cout << "TLE x " << T << endl;
  cout << "RE x " << R << endl;
}
