#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[5] = {"AC", "WA", "TLE", "RE"};
  int C0 = 0, C1 = 0, C2 = 0, C3 = 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")
      C0 += 1;
    else if (arr_2[j] == "WA")
      C1 += 1;
    else if (arr_2[j] == "TLE")
      C2 += 1;
    else if (arr_2[j] == "RE")
      C3 += 1;
  }
  cout << "AC  X"
       << " " << C0 << endl;
  cout << "WA  X"
       << " " << C1 << endl;
  cout << "TLE  X"
       << " " << C2 << endl;
  cout << "RE  X"
       << " " << C3 << endl;
  return 0;
}
