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