#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<string> s(n);
  int c0 = 0;
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC")
      c0++;
    else if (s[i] == "WA")
      c1++;
    else if (s[i] == "TLE")
      c2++;
    else
      c3++;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
}
