#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int arr1 = 0, arr2 = 0, arr3 = 0, arr4 = 0;
  for (int i = 0; i < n; i++) {
    char str[5];
    scanf("%s", str);
    if (str[0] = 'A')
      arr1++;
    else if (str[0] == 'W')
      arr2++;
    else if (str[0] == 'T')
      arr3++;
    else
      arr4++;
  }
  printf("AC x %d\n", arr1);
  printf("WA x %d\n", arr2);
  printf("TLE x %d\n", arr3);
  printf("RE x %d\n", arr4);
  return 0;
}
