#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  string s[N];
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < N; i++) {
    if (s[i] == "AC") ac++;
    if (s[i] == "wa") wa++;
    if (s[i] == "tle") tle++;
    if (s[i] == "re") re++;
  }
  cout << "AC x " + ac << endl;
  cout << "WA x " + wa << endl;
  cout << "TLE x " + tle << endl;
  cout << "RE x " + re << endl;
}
