#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, a, w, t, r;
  cin >> N;
  a=0;
  w=0;
  t=0;
  r=0;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  for (int j = 0; j < N; j++) {
    if (S.at(j)=="AC") {
      a=a+1;
    }
    else {
      if (S.at(j)=="WA") {
        w=w+1;
      }
      else {
        if (S.at(j)=="TLE") {
          t=t+1;
        }
        else {
          r=r+1;
        }
      }
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r endl;
}
