#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  size_t num_ac = 0;
  size_t num_wa = 0;
  size_t num_tle = 0;
  ;
  size_t num_re = 0;
  ;
  cin >> n;
  vector<string> s;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    s.push_back(str);
  }
  num_ac = count(s.begin(), s.end(), "AC");
  num_wa = count(s.begin(), s.end(), "WA");
  num_tle = count(s.begin(), s.end(), "TLE");
  num_re = count(s.begin(), s.end(), "RE");
  cout << "AC x " << num_ac << "\n";
  cout << "WA x " << num_wa << "\n";
  cout << "TLE x " << num_tle << "\n";
  cout << "RE x " << num_re << "\n";
}
