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