#include <bits/stdc++.h>
using namespace std;
int main() {
  int N{};
  cin >> N;
  string Si[N];
  for (int i{}; i < N; i++) {
    cin >> Si[i];
  }
  int C1, C2, C3, C0 = 0;
  for (auto i : Si) {
    if (i == "AC") C0 += 1;
    if (i == "WA") C1 += 1;
    if (i == "TLE") C2 += 1;
    if (i == "RE") C3 += 1;
  }
  cout << "AC x " << C0 << endl;
  cout << "WA x " << C1 << endl;
  cout << "TLE x " << C2 << endl;
  cout << "RE x " << C3 << endl;
  return 0;
}
