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