#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  int ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else if (s == "RE")
      re++;
  }
  cout << "AC X " << ac << "\n"
       << "WA X " << wa << "\n"
       << "TLE X " << tle << "\n"
       << "RE X " << re << "\n";
  return 0;
}
