#include <bits/stdc++.h>
using namespace std;
int main() {
  int c[4];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") c[0]++;
    if (s == "WA") c[1]++;
    if (s == "TLE") c[2]++;
    if (s == "RE") c[3]++;
  }
  printf("AC x %d\n", c[0]);
  printf("WA x %d\n", c[1]);
  printf("TLE x %d\n", c[2]);
  printf("RE x %d\n", c[3]);
  return 0;
}
