#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  vector<int> c(4, 0);
  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;
}
