#include <bits/stdc++.h>
using namespace std;
int main() {
  int acnum, wanum, tlenum, renum, N;
  string b;
  acnum = 0;
  wanum = 0;
  tlenum = 0;
  renum = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> b;
    if (b == "AC")
      acnum++;
    else if (b == "WA")
      wanum++;
    else if (b == "TLE")
      tlenum++;
    else if (b == "RE ")
      renum++;
  }
  cout << "AC x " << acnum << "\n";
  cout << "WA x " << wanum << "\n";
  cout << "TLE x " << tlenum << "\n";
  cout << "RE x " << renum << "\n";
  return 0;
}
