#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  for (int i = 0; i < t; i++) {
    string n;
    cin >> n;
    if (n == "AC") {
      AC += 1;
    } else if (n == "WA") {
      WA += 1;
    } else if (n == "TLE") {
      TLE += 1;
    } else if (n == "RE") {
      RE += 1;
    }
  }
  cout << "AC "
       << "X " << AC << "\n";
  cout << "WA "
       << "X " << WA << "\n";
  cout << "TLE "
       << "X " << TLE << "\n";
  cout << "RE "
       << "X " << RE << "\n";
  return 0;
}
