#include <bits/stdc++.h>
using namespace std;
int main() {
  string S[254];
  char s[254];
  int N;
  int C[4] = {0};
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> s;
    S[i] = s;
    if (S[i] == "AC")
      C[0]++;
    else if (S[i] == "WA")
      C[1]++;
    else if (S[i] == "TLE")
      C[2]++;
    else if (S[i] == "RE")
      C[3]++;
  }
  cout << "AC x " << C[0] << '\n';
  cout << "WA x " << C[1] << '\n';
  cout << "TLE x " << C[2] << '\n';
  cout << "RE x " << C[3] << '\n';
  return 0;
}
