#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> count(N, 0);
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "AC") {
      count.at(0)++;
    } else if (S == "WA") {
      count.at(1)++;
    } else if (S == "TLE") {
      count.at(2)++;
    } else if (S == "RE") {
      count.at(3)++;
    }
  }
  printf("AC x %d\n", count.at(0));
  printf("WA x %d\n", count.at(1));
  printf("TLE x %d\n", count.at(2));
  printf("RE x %d\n", count.at(3));
}
