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