#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  int ca = 0, cw = 0, ct = 0, cr = 0;
  while (n--) {
    cin >> s;
    if (s == "AC") ca++;
    if (s == "WA") cw++;
    if (s == "TLE") ct++;
    if (s == "RE") cr++;
  }
  cout << "AC x " << ca << "\n"
       << "WA x " << cw << "\n"
       << "TLE x " << ct << "\n"
       << "RE x" << cr << "\n";
}
