#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a = 0, w = 0, t = 0, r = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      w++;
    else if (s == "TLE")
      t++;
    else if (s == "RE")
      r++;
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", w);
  printf("TLE x %d\n", t);
  printf("RE x %d\n", r);
  return 0;
}
