#include <bits/stdc++.h>
enum hantei { AC, WA, TLE, RE };
int main(void) {
  int a, c = 0, d = 0, e = 0, f = 0, i;
  scanf("%d", &a);
  enum hantei b;
  for (i = 0; i <= a; i++) {
    scanf("%d", &b);
    switch (b) {
      case AC:
        c++;
        break;
      case WA:
        d++;
        break;
      case TLE:
        e++;
        break;
      case RE:
        f++;
        break;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", c, d, e, f);
  return 0;
}
