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