#include <bits/stdc++.h>
using namespace std;
int main() {
  int frek[4] = {0};
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if (s == "AC") ++frek[0];
    if (s == "WA") ++frek[1];
    if (s == "TLE") ++frek[2];
    if (s == "RTE") ++frek[3];
  }
  cout << "AC x " << frek[0] << '\n';
  cout << "WA x " << frek[1] << '\n';
  cout << "TLE x " << frek[2] << '\n';
  cout << "RTE x " << frek[3] << '\n';
}
