#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, w = 0, t = 0, r = 0;
  cin >> n;
  vector<string> v(n);
  vector<string>::iterator it;
  for (it = v.begin(); it != v.end(); it++) cin >> *it;
  for (it = v.begin(); it != v.end(); it++) {
    if (*it == "AC")
      c++;
    else if (*it == "WA")
      w++;
    else if (*it == "TLE")
      t++;
    else if (*it == "RE")
      r++;
  }
  cout << "AC X " << c << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << t << endl;
  cout << "RE X " << r << endl;
}
