#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 1;
  vector<string> C(N);
  vector<int> ANS(4);
  for (int i = 0; i < N; i++) {
    cin >> C.at(i);
  }
  for (int i = 0; i < N; i++) {
    if (C.at(i) == "AC") ANS.at(0)++;
    if (C.at(i) == "WA") ANS.at(1)++;
    if (C.at(i) == "TLE") ANS.at(2)++;
    if (C.at(i) == "RE") ANS.at(3)++;
  }
  cout << "AC x " << ANS.at(0) << endl;
  cout << "WA x " << ANS.at(1) << endl;
  cout << "TLE x " << ANS.at(2) << endl;
  cout << "RE x " << ANS.at(3) << endl;
}
