#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a, b, c, d;
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  cin >> N;
  string C;
  for (int i = 0; i < N; i++) {
    cin >> C;
    if (C == "AC") {
      a++;
    }
    if (C == "WA") {
      b++;
    }
    if (C == "TLE") {
      c++;
    }
    if (C == "RE") {
      d++;
    }
  }
  cout << "AC"
       << " " << 'x' << " " << a << endl;
  cout << "WA"
       << " " << 'x' << " " << b << endl;
  cout << "TLE"
       << " " << 'x' << " " << c << endl;
  cout << "WA"
       << " " << 'x' << " " << d << endl;
}
