#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int cac = 0;
  int cwa = 0;
  int ctle = 0;
  int cre = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") {
      cac++;
    } else if (s == "RE") {
      cre++;
    } else if (s == "TLE") {
      ctle++;
    } else if (s == "WA") {
      cwa++;
    }
  }
  cout << "AC X " << cac << endl;
  cout << "WA X " << cwa << endl;
  cout << "TLE X " << ctle << endl;
  cout << "RE X " << cre << endl;
}
int main() {
  solve();
  return 0;
}
