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