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