#include <bits/stdc++.h>
int a, AC, WA, TLE, RE;
char b[10000], A[10] = ("AC"), W[10] = ("WA"), T[10] = ("TLE"), R[10] = ("RE");
int main() {
  scanf("%d", &a);
  for (int i = 0; i + 1 <= a; i++) {
    scanf("%s", &b[i]);
  }
  for (int j = 0; j + 1 <= a; j++) {
    if (b[j] == A[0])
      AC = AC + 1;
    else if (b[j] == W[0])
      WA = WA + 1;
    else if (b[j] == T[0])
      TLE = TLE + 1;
    else if (b[j] == R[0])
      RE = RE + 1;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC, WA, TLE, RE);
  return 0;
}
