#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int acCounter = 0;
  int waCounter = 0;
  int tleCounter = 0;
  int reCounter = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      acCounter++;
    }
    if (s == "WA") {
      waCounter++;
    }
    if (s == "TLE") {
      tleCounter++;
    }
    if (s == "RE") {
      reCounter++;
    }
    cout << "AC"
         << " x " << acCounter << endl;
    cout << "WA"
         << " x " << waCounter << endl;
    cout << "TLE"
         << " x " << tleCounter << endl;
    cout << "RE"
         << " x " << reCounter << endl;
  }
}
