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

int main() {
  int N;
  cin << N;
  int a, b, c, d;
  for (int i = 0; i < N; i++) {
    string S;
    cin << S;
    if (S == "AC")
      a++;
    else if (S == "WA")
      b++;
    else if (S == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}