#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC")
      a++;
    else if (s[i] == "WA")
      b++;
    else if (s[i] == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC * " << a << endl;
  cout << "WA * " << b << endl;
  cout << "TLE * " << c << endl;
  cout << "RE * " << d << endl;
  exit(0);
}
