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