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