#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a, w, t, r;
  string c[n];
  cin >> n;
  for (int z = 0; z < n; z++) {
    cin >> c[z];
  }
  for (int x = 0; x < n; x++) {
    if (c[x] == "AC") {
      a += 1;
    } else if (c[x] == "WA") {
      w += 1;
    } else if (c[x] == "TLE") {
      t += 1;
    } else {
      r += 1;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << a << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}
