#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) cin >> arr[n];
  for (int i = 0; i < n; i++) {
    if (arr[i] == "AC")
      a += 1;
    else if (arr[i] == "WA")
      b += 1;
    else if (arr[i] == "TLE")
      c += 1;
    else if (arr[i] == "RE")
      d += 1;
  }
  cout << "AC x " << a << endl
       << "WA x " << b << endl
       << "TLE x " << c << endl
       << "RE x " << d << endl;
  return 0;
}
