#include <bits/stdc++.h>
int main(void) {
  int count;
  scanf("%d", &count);
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < count; i++) {
    char input[4];
    scanf("%s", input);
    int num = 0;
    for (int i = 0; i < 4; i++) {
      num += (int)input[i];
    }
    switch (num) {
      case 132:
        ac++;
        break;
      case 151:
        re++;
        break;
      case 152:
        wa++;
        break;
      case 229:
        tle++;
        break;
      default:
        break;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("re x %d\n", re);
  return 0;
}
