#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  while (N--) {
    string s;
    cin >> s;
    if (s == "AC") {
      AC++;
    } else if (s == "WA") {
      WA++;
    } else if (s == "TLE") {
      TLE++;
    } else if (s == "RE") {
      RE++;
    }
  }
  cout << "AC x " + AC << "\n";
  cout << "WA x " + WA << "\n";
  cout << "TLE x " + TLE << "\n";
  cout << "RE x " + RE;
  return 0;
}
