#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int b, c, d, e, f = 0;
  vector<string> vec(a);
  for (int i = 0; i < a; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < a; i++) {
    if (vec.at(i) == "AC") {
      b++;
      f++;
    } else if (vec.at(i) == "WA") {
      c++;
    } else if (vec.at(i) == "TLE") {
      d++;
    } else if (vec.at(i) == "RE") {
      e++;
    }
  }
  cout << "AC x ";
  cout << b << endl;
  cout << "WA x ";
  cout << c << endl;
  cout << "TLE x ";
  cout << d << endl;
  cout << "RE x ";
  cout << e << endl;
}
