#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[] = {0, 0, 0, 0};
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string str;
    getline(cin, str);
    if (str.compare("AC") == 0) {
      arr[0] = arr[0] + 1;
    }
    if (str.compare("WA") == 0) {
      arr[1] = arr[1] + 1;
    }
    if (str.compare("TLE") == 0) {
      arr[2] = arr[2] + 1;
    }
    if (str.compare("RE") == 0) {
      arr[3] = arr[3] + 1;
    }
  }
  cout << "AC x " << arr[0] << "\n";
  cout << "WA x " << arr[1] << "\n";
  cout << "TLE x " << arr[2] << "\n";
  cout << "RE x " << arr[3] << "\n";
}
