#include <bits/stdc++.h>
using namespace std;
void c_p_c() {}
void solutionA() {
  long long n;
  cin >> n;
  if (n % 1000 == 0) {
    cout << "0" << endl;
  } else {
    cout << 1000 - (n % 1000) << endl;
  }
}
void solutionB() {
  long long n;
  cin >> n;
  long long a = 0, b = 0, c = 0, d = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") {
      a++;
    } else if (s == "TLE") {
      b++;
    } else if (s == "WA") {
      c++;
    } else {
      d++;
    }
  }
  cout << "AC"
       << " * " << a << endl;
  cout << "WA"
       << " * " << c << endl;
  cout << "TLE"
       << " * " << b << endl;
  cout << "RE"
       << " * " << d << endl;
}
void solutionC() {}
int32_t main() {
  c_p_c();
  solutionB();
  return 0;
}
