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