#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read() {
  T s = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    s = (s << 3) + (s << 1) + ch - 48;
    ch = getchar();
  }
  return s * f;
}
template <typename T>
inline void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int N = 2e5 + 100;
map<string, int> mp;
int main() {
  int n = read<int>();
  for (register int i = 0; i < (n); ++i) {
    string k;
    cin >> k;
    mp[k]++;
  }
  printf("AC x %d\n", mp["AC"]);
  printf("WA x %d\n", mp["WA"]);
  printf("TLE x %d\n", mp["TLE"]);
  printf("WA x %d\n", mp["WA"]);
}
