#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  unsigned long long t;
  cin >> t;
  unsigned long long a = 0, w = 0, tl = 0, re = 0;
  vector<string> str(t);
  for (string &s : str) {
    cin >> s;
    if (s == "AC")
      ++a;
    else if (s == "WA")
      ++w;
    else if (s == "TLE")
      ++tl;
    else
      ++re;
  }
  cout << "AC X " << a << "\n"
       << "WA X " << w << "\n"
       << "TLE X " << tl << "\n"
       << "RE X " << re << "\n";
  return 0;
}
