#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int k, k1, k2, k3;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == "AC")
      k++;
    else if (s == "TLE")
      k1++;
    else if (s == "WA")
      k2++;
    else if (s == "RE")
      k3++;
  }
  printf("AC x %d\n", k);
  printf("WA x %d\n", k1);
  printf("TLE x %d\n", k2);
  printf("RE x %d\n", k3);
}
