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