#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  cin >> n;
  int s[4] = {0};
  string si[n];
  for (i = 0; i < n; i++) cin >> si[i];
  for (i = 0; i < n; i++) {
    if (si[i] == "AC") s[0]++;
    if (si[i] == "WA") s[1]++;
    if (si[i] == "TLE")
      s[2]++;
    else
      s[3]++;
  }
  cout << "AC x " << s[0] << endl;
  cout << "WA x " << s[1] << endl;
  cout << "TLE x " << s[2] << endl;
  cout << "RE x " << s[3] << endl;
  return 0;
}
