#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ac, wa, tle, re;
  ac = 0;
  wa = 0;
  tle = 0;
  re = 0;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s.at(i);
    if (s.at(i) == "AC") {
      ac++;
    } else if (s.at(i) == "WA") {
      wa++;
    } else if (s.at(i) == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << "AC x　" << ac << endl;
  cout << "WA x　" << wa << endl;
  cout << "TLE x　" << tle << endl;
  cout << "RE x　" << re << endl;
}
