#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  long long int a[4] = {0};
  string s;
  cin >> t;
  while (t--) {
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "WA")
      a[1]++;
    else if (s == "TLE")
      a[2]++;
    else if (s == "RE")
      a[3]++;
    else
      ;
  }
  cout << "AC x " << a[0] << "\n";
  cout << "WA x " << a[1] << "\n";
  cout << "TLE x " << a[2] << "\n";
  cout << "RE x" << a[3] << "\n";
  return 0;
}
