#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  long long m;
  long long k;
  string s[10000000];
  long long box = 0;
  long long ac = 0;
  long long wa = 0;
  long long tle = 0;
  long long re = 0;
  long long count = 0;
  long long all = 0;
  bool flag = false;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC") {
      ac++;
    } else if (s[i] == "WA") {
      wa++;
    } else if (s[i] == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << "AC x " << ac << "\n";
  cout << "WA x " << wa << "\n";
  cout << "TLE x " << tle << "\n";
  cout << "RE x " << re << "\n";
}
