#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long wa = 0;
  long long ac = 0;
  long long tle = 0;
  long long re = 0;
  string str;
  while (n--) {
    cin >> str;
    if (str == "AC")
      ac++;
    else if (str == "WA")
      wa++;
    else if (str == "tle")
      tle++;
    else {
      re++;
    }
  }
  cout << "AC x " << ac << "\n";
  cout << "WA x " << wa << "\n";
  cout << "TLE x " << tle << "\n";
  cout << "RE x " << re << "\n";
}
