#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int ct = 0, st = 0, at = 0, rt = 0;
  while (n--) {
    cin >> s;
    if (s == "AC")
      ct++;
    else if (s == "WA")
      st++;
    else if (s == "TLE")
      at++;
    else if (s == "RE")
      rt++;
  }
  cout << "AC x" << ' ' << ct << "\n"
       << "WA x" << ' ' << st << "\n"
       << "TLE x" << ' ' << at << "\n"
       << at << "RE x" << ' ' << "\n";
  return 0;
}
