#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[5] = {"AC", "WA", "TLE", "RE"};
  int count_ac = 0, count_wa = 0, count_tle = 0, count_re = 0;
  int N;
  cin >> N;
  string arr_2[N];
  for (int i = 0; i < N; i++) {
    cin >> arr_2[i];
  }
  for (int j = 0; j < N; j++) {
    if (arr_2[j] == "AC")
      count_ac += 1;
    else if (arr_2[j] == "WA")
      count_wa += 1;
    else if (arr_2[j] == "TLE")
      count_tle += 1;
    else if (arr_2[j] == "RE")
      count_re += 1;
  }
  cout << "AC  X"
       << " " << count_ac << endl;
  cout << "WA  X"
       << " " << count_wa << endl;
  cout << "TLE  X"
       << " " << count_tle << endl;
  cout << "RE  X"
       << " " << count_re << endl;
  return 0;
}
