#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::string;
int main() {
  int N;
  cin >> N;
  string s[N];
  int count[4];
  memset(count, 0, sizeof(count));
  for (int i = 0; i < N; i++) cin >> s[i];
  for (int k = 0; k < N; k++) {
    if (s[k] == "AC") count[0]++;
    if (s[k] == "WA") count[1]++;
    if (s[k] == "TLE") count[2]++;
    if (s[k] == "RE") count[3]++;
  }
  cout << "AC X " << count[0] << '\n';
  cout << "WA X " << count[1] << '\n';
  cout << "TLE X " << count[2] << '\n';
  cout << "RE X " << count[3];
  return 0;
}
