#include <bits/stdc++.h>
using namespace std;
int main() {
  int c;
  cin >> c;
  int ac_count, wa_count, tle_count, re_count = 0;
  for (int i = 0; i < c; c++) {
    string m;
    cin >> m;
    if (m == "AC") {
      ac_count += 1;
    } else if (m == "WA") {
      wa_count += 1;
    } else if (m == "TLE") {
      tle_count += 1;
    } else if (m == "RE") {
      re_count += 1;
    } else {
      return 0;
    }
  }
  cout << "AC x " << ac_count << endl;
  cout << "WA x " << wa_count << endl;
  cout << "TLE x " << tle_count << endl;
  cout << "RE x " << re_count << endl;
  return 0;
}
