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