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