#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  cin >> ws;
  long long a = 0, b = 0, c = 0, d = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      a++;
    }
    if (s == "WA") {
      b++;
    }
    if (s == "RE") {
      c++;
    }
    if (s == "TLE") {
      d++;
    }
  }
  cout << "AC "
       << "X " << a << "\n";
  cout << "WA "
       << "X " << b << "\n";
  cout << "TLE "
       << "X " << d << "\n";
  cout << "RE "
       << "X " << c << "\n";
  return 0;
}
