#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, ac = 0, wa = 0, tle = 0, re = 0;
  char **arr;
  cin >> n;
  arr = new char *[n];
  for (i = 0; i < n; i++) {
    arr[i] = new char[4];
    cin >> arr[i];
    if (arr[i][0] == 'A')
      ac++;
    else if (arr[i][0] == 'W')
      wa++;
    else if (arr[i][0] == 'T')
      tle++;
    else if (arr[i][0] == 'R')
      re++;
  }
  cout << "AC x" << ac << '\n';
  cout << "WA x" << wa << '\n';
  cout << "TLE x" << tle << '\n';
  cout << "RE x" << re << '\n';
  return 0;
}
