#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> v(4, 0);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      v[0]++;
    else if (s == "WA")
      v[1]++;
    else if (s == "TLE")
      v[2]++;
    else if (s == "RE")
      v[3]++;
  }
  cout << "AC x " << v[0] << endl;
  cout << "WA x " << v[1] << endl;
  cout << "TLE x " << v[2] << endl;
  cout << "RE x " << v[3] << endl;
  return 0;
}
