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