#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8 + 1;
int main() {
  int n;
  cin >> n;
  map<string, int> words;
  words["AC"] = 0;
  words["WA"] = 0;
  words["TLE"] = 0;
  words["RE"] = 0;
  for (int i = 0; i < n; i++) {
    string aux;
    cin >> aux;
    words[aux]++;
  }
  cout << "AC x " << words["AC"] << endl;
  cout << "WA x " << words["WA"] << endl;
  cout << "TLE x " << words["TLE"] << endl;
  cout << "RE x " << words["RE"] << endl;
}
