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