#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;
  string array[100];
  cin >> N;
  if (N >= 1 && N <= 10 ^ 5) {
    for (int i = 0; i < N; i++) {
      cin >> array[i];
      if (array[i] == "AC")
        AC_count++;
      else if (array[i] == "WA")
        WA_count++;
      else if (array[i] == "TLE")
        TLE_count++;
      else if (array[i] == "RE")
        RE_count++;
    }
  }
  cout << "AC X " << AC_count << endl
       << "WA X " << WA_count << endl
       << "TLE X " << TLE_count << endl
       << "RE X " << RE_count << endl;
}
