#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
  int n;
  cin >> n;
  vector<string> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  int c0, c1, c2, c3;
  for (int i = 0; i < n; i++) {
    if (vec.at(i) == "AC") {
      c0++;
    } else if (vec.at(i) == "WA") {
      c1++;
    } else if (vec.at(i) == "TLE") {
      c2++;
    } else {
      c3++;
    }
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
}
