#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> N;
  string S;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S.compare("AC") == 0)
      ac++;
    else if (S.compare("WA") == 0)
      wa++;
    else if (S.compare("TLE"))
      tle++;
    else
      re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
