#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int c[4] = {};
  cin >> N;
  string i;
  while (N != 0) {
    cin >> i;
    if (i == "AC")
      c[0]++;
    else if (i == "WA")
      c[1]++;
    else if (i == "TLE")
      c[2]++;
    else if (i == "RE")
      c[3]++;
    N--;
  }
  cout << "AC"
       << " * " << c[0] << endl;
  cout << "WA"
       << " * " << c[1] << endl;
  cout << "TLE"
       << " * " << c[2] << endl;
  cout << "RE"
       << " * " << c[3] << endl;
}
