#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int N;
  cin >> N;
  long long int arr[5] = {0};
  string str;
  for (int i = 0; i < N; ++i) {
    cin >> str;
    if (str == "AC") arr[0]++;
    if (str == "WA") arr[1]++;
    if (str == "TLE") arr[2]++;
    if (str == "RE") arr[3]++;
  }
  cout << "AC X " << arr[0] << "\n";
  cout << "WA X " << arr[1] << "\n";
  cout << "TLE X " << arr[2] << "\n";
  cout << "RE X " << arr[3] << "\n";
  return 0;
}
