#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  for (int i = 0; i < n; i++) {
    if (i == 'AC') {
      a++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == 'WA') {
      b++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == 'TLE') {
      c++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == 'RE') {
      d++;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}
