#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string str;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  while (t--) {
    cin >> str;
    if (str == "AC") {
      c1++;
    }
    if (str == "WA") {
      c2++;
    }
    if (str == "TLE") {
      c3++;
    }
    if (str == "RE") {
      c4++;
    }
  }
  cout << "AC x " << c1 << endl;
  cout << "WA x " << c2 << endl;
  cout << "TLE x" << c3 << endl;
  cout << "RE x" << c4 << endl;
}
