#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, c = 0, c1 = 0, c2 = 0, c3 = 0;
  cin >> t;
  string s;
  for (int i = 0; i < t; i++) {
    cin >> s;
    if (s == "AC") {
      c++;
    } else if (s == "WA") {
      c1++;
    } else if (s == "TLE") {
      c2++;
    } else {
      c3++;
    }
  }
  cout << "AC x " << c << endl;
  cout << "WC x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
}
