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