#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ac_count = 0, wa_count = 0, tle_count = 0, re_count = 0;
  string j;
  cin >> N;
  while (cin >> j) {
    if (equal(j.begin(), j.end(), "AC") == 0) {
      ac_count++;
    } else if (equal(j.begin(), j.end(), "WA") == 0) {
      wa_count++;
    } else if (equal(j.begin(), j.end(), "TLE") == 0) {
      tle_count++;
    } else if (equal(j.begin(), j.end(), "RE") == 0) {
      re_count++;
    }
  }
  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;
}
