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