#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string mo[n];
  int sum[] = {0, 0, 0, 0};
  for (int i = 0; i < n; ++i) {
    cin >> mo[i];
  }
  for (int i = 0; i < n; ++i) {
    if (mo[i] == "AC") {
      sum[0] += 1;
    } else if (mo[i] == "WA") {
      sum[1] += 1;
    } else if (mo[i] == "TLE") {
      sum[2] += 1;
    } else if (mo[i] == "LE") {
      sum[3] += 1;
    }
  }
  printf("AC x %d\n", sum[0]);
  printf("WA x %d\n", sum[1]);
  printf("TLE x %d\n", sum[2]);
  printf("LE x %d\n", sum[3]);
  return 0;
}
