#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int f = 0, g = 0, h = 0, i = 0;
  string kase[10 ^ 5];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> kase[i];
  }
  for (int u = 0; u < n; u++) {
    if (kase[u] == "AC") {
      f = f + 1;
    } else if (kase[u] == "WA") {
      g = g + 1;
    } else if (kase[u] == "TLE") {
      h = h + 1;
    } else if (kase[u] == "RE") {
      i = i + 1;
    }
  }
  cout << "AC x"
       << " " << f << endl;
  cout << "WA x"
       << " " << g << endl;
  cout << "TLE x"
       << " " << h << endl;
  cout << "RE x"
       << " " << i << endl;
  return 0;
}
