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