#include <bits/stdc++.h>
using namespace std;
char _;
int AC = 0, TLE = 0, WA = 0, RE = 0;
int main() {
  int n;
  do {
    while ((n = getchar()) < '0')
      ;
    for (n -= '0'; '0' <= (_ = getchar()); n = (n << 3) + (n << 1) + _ - '0')
      ;
  } while (0);
  while (n--) {
    string k;
    cin >> k;
    if (k == "AC")
      AC++;
    else if (k == "WA")
      WA++;
    else if (k == "TLE")
      TLE++;
    else
      RE++;
  }
  cout << "AC X " << AC << "\n";
  cout << "WA X " << WA << "\n";
  cout << "TLE X " << TLE << "\n";
  cout << "RE X " << RE << "\n";
}
