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