#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  vector<string> vec(N, "");
  for (int i = 0; i < N; i++) {
    cin >> vec[i];
  }
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < N; i++) {
    if (vec[i] == "AC") {
      AC++;
    } else if (vec[i] == "WA") {
      WA++;
    } else if (vec[i] == "TLE") {
      TLE++;
    } else if (vec[i] == "RE") {
      RE++;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "AC x " << WA << endl;
  cout << "AC x " << TLE << endl;
  cout << "AC x " << RE << endl;
}
