#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int cntac = 0;
  long long int cntwa = 0;
  long long int cnttle = 0;
  long long int cntre = 0;
  string x;
  long long int i;
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (x == "AC") {
      cntac = cntac + 1;
    } else if (x == "WA") {
      cntwa = cntwa + 1;
    } else if (x == "TLE") {
      cnttle = cnttle + 1;
    } else if (x == "RE") {
      cntre = cntre + 1;
    }
  }
  cout << "AC "
       << "X " << cntac << "\n";
  cout << "WA "
       << "X " << cntwa << "\n";
  cout << "TLE "
       << "X " << cnttle << "\n";
  cout << "RE "
       << "X " << cntre << "\n";
  return 0;
}
