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