#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int count_ac = 0;
  int count_wa = 0;
  int count_tle = 0;
  int count_re = 0;
  int i;
  string ans;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ans;
    if (ans == "AC") {
      count_ac++;
    } else if (ans == "WA") {
      count_wa++;
    } else if (ans == "TLE") {
      count_tle++;
    } else {
      count_re++;
    }
  }
  cout << "AC X " << count_ac << endl;
  cout << "WA X " << count_wa << endl;
  cout << "TLE X " << count_tle << endl;
  cout << "RE X " << count_re << endl;
}
