#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int ret[4] = {};
  for (int i = (0); i < (N); ++i) {
    string s;
    cin >> s;
    if (s == "AC")
      ret[0]++;
    else if (s == "WA")
      ret[1]++;
    else if (s == "TLE")
      ret[2]++;
    else if (s == "RE")
      ret[3]++;
  }
  cout << "AC x " << ret[0] << endl;
  cout << "WA x " << ret[1] << endl;
  cout << "TLE x " << ret[2] << endl;
  cout << "RE x " << ret[3] << endl;
  return 0;
}
