#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  long long ac, wa, tle, re = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      ac += 1;
    } else if (s == "WA") {
      wa += 1;
    } else if (s == "TLE") {
      tle += 1;
    } else if (s == "RE") {
      re += 1;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
