#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int i = 0;
  string input;
  int acc, wac, tlec, rec;
  while (i < N) {
    cin >> input;
    if (input == "AC") {
      ++acc;
    } else if (input == "WA") {
      ++wac;
    } else if (input == "TLE") {
      ++tlec;
    } else {
      ++rec;
    }
    ++i;
  }
  cout << "AC x " << acc << endl;
  cout << "WA x " << wac << endl;
  cout << "TLE x " << tlec << endl;
  cout << "RE x " << rec << endl;
}
