#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string ip;
  cin >> N;
  int count[4] = {0, 0, 0, 0};
  for (int i = 0; i < N; i++) {
    cin >> ip;
    if (ip.compare("AC") == 0) {
      count[0]++;
    } else if (ip.compare("WA")) {
      count[1]++;
    } else if (ip.compare("TLE")) {
      count[2]++;
    } else if (ip.compare("RE")) {
      count[3]++;
    }
  }
  cout << "AC x " << count[0] << endl;
  cout << "WA x " << count[1] << endl;
  cout << "TLE x " << count[2] << endl;
  cout << "RE x " << count[3] << endl;
  return 0;
}
