#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int c[4] = {};
  string S;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC")
      c[0]++;
    else if (S == "WA")
      c[1]++;
    else if (S == "TLE")
      c[2]++;
    else if (S == "RE")
      c[3]++;
  }
  cout << "AC x" << c[0] << endl;
  cout << "WA x" << c[1] << endl;
  cout << "TLE x" << c[2] << endl;
  cout << "RE x" << c[3] << endl;
  return 0;
}
