#include <bits/stdc++.h>
using namespace std;
const int INF = 99999999;
const long long LINF = 9999999999999;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
long long N, ac = 0, wa = 0, tle = 0, re = 0;
int main() {
  cin >> N;
  for (int i = 0; i < (N); i++) {
    string tmp;
    cin >> tmp;
    if (tmp == "AC") {
      ac++;
    }
    if (tmp == "TLE") {
      tle++;
    }
    if (tmp == "WA") {
      wa++;
    }
    if (tmp == "re") {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
