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