#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> judge;
  judge["AC"] = 0;
  judge["WA"] = 0;
  judge["TLE"] = 0;
  judge["RE"] == 0;
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string tmp;
    cin >> tmp;
    if (tmp == "AC") {
      judge["AC"]++;
    } else if (tmp == "WA") {
      judge["WA"]++;
    } else if (tmp == "TLE") {
      judge["TLE"]++;
    } else if (tmp == "RE") {
      judge["RE"];
    }
  }
  cout << "AC x " << judge["AC"] << endl;
  cout << "WA x " << judge["WA"] << endl;
  cout << "TLE x " << judge["TLE"] << endl;
  cout << "RE x " << judge["RE"] << endl;
}
