#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j;
  cin >> t;
  int c = 0, cn = 0, cn1 = 0, cn2 = 0;
  while (t--) {
    string s, ss;
    cin >> s;
    if (s == "AC")
      c++;
    else if (s == "TLE")
      cn++;
    else if (s == "WA")
      cn1++;
    else if (s == "RE")
      cn2++;
  }
  cout << "AC X " << c << endl
       << "WA X " << cn1 << endl
       << "TLE X " << cn << endl
       << "RE X " << cn2 << endl;
  return 0;
}
