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