#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int A[1000000];
  int i;
  int C0 = 0, C1 = 0, C2 = 0, C3 = 0;
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (i = 0; i < N; i++) {
    if (A[i] == 'AC') {
      C0++;
    } else if (A[i] == 'WA') {
      C1++;
    } else if (A[i] == 'TLE') {
      C2++;
    } else if (A[i] == 'RE') {
      C3++;
    }
  }
  printf("AC x %d\n", C0);
  printf("WA x %d\n", C1);
  printf("TLE x %d\n", C2);
  printf("RE x %d\n", C3);
  return 0;
}
