#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      AC_count++;
    } else if (s == "WA") {
      WA_count++;
    } else if (s == "TLE") {
      TLE_count++;
    } else if (s == "RE") {
      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;
}
