#include <bits/stdc++.h>
using namespace std;
int ac, wa, tle, ra;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") {
      ac++;
    } else if (s == "RA") {
      ra++;
    } else if (s == "TLE") {
      tle++;
    } else {
      wa++;
    }
  }
  printf("AC  x  %d\n", ac);
  printf("WA  x  %d\n", wa);
  printf("TLE  x  %d\n", tle);
  printf("RA  x  %d\n", ra);
  return 0;
}
