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