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