#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int AC, WA, TLE, RE = 0;
  vector<char*> S(N);
  for (auto& x : S) {
    cin >> x;
  }
  for (const auto& x : S) {
    if (strncmp(x, "AC", 2)) {
      AC++;
    } else if (strncmp(x, "WA", 2)) {
      WA++;
    } else if (strncmp(x, "TLE", 3)) {
      TLE++;
    } else {
      RE++;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
}
