#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string ans, input;
  int arr[4] = {0, 0, 0, 0};
  while (n--) {
    cin >> input;
    if (input == "AC")
      arr[0] += 1;
    else if (input == "WA")
      arr[1] += 1;
    else if (input == "TLE")
      arr[2] += 1;
    else
      arr[3] += 1;
  }
  cout << "AC X " << arr[0] << endl;
  cout << "WA X " << arr[1] << endl;
  cout << "TLE X " << arr[2] << endl;
  cout << "RE X " << arr[3];
}
