#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int x = 0, w = 0, r = 0, a = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "TLE")
      x++;
    else if (s == "AC")
      a++;
    else if (s == "WA")
      w++;
    else if (s == "RE")
      r++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << x << endl;
  cout << "RE X " << r << endl;
  return 0;
}
