#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, j;
  int ac = 0;
  int tle = 0;
  int wa = 0;
  int re = 0;
  cin >> i;
  if (0 < i && i < 100001) {
    string d[i];
    for (j = 0; j < i; j++) {
      cin >> d[j];
    }
    for (int k = 0; k < i; k++) {
      if (d[k] == "AC") {
        ac++;
      } else if (d[k] == "WA") {
        wa++;
      } else if (d[k] == "TLE") {
        tle++;
      } else if (d[k] == "re") {
        re++;
      }
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
  }
  return 0;
}
