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