#include <bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL),
      cout.precision(10);
  string s;
  int m = 0, n = 0, o = 0, p = 0;
  int t;
  cin >> t;
  while (t--) {
    cin >> s;
    if (s == "AC")
      m++;
    else if (s == "WA")
      n++;
    else if (s == "TLE")
      o++;
    else
      p++;
  }
  cout << "AC * " << m << endl;
  cout << "WA * " << n << endl;
  cout << "TLE * " << o << endl;
  cout << "RE * " << p << endl;
}
