#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  int a, b, c, d;
  a = b = c = d = 0;
  while (n--) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC * " << a << endl;
  cout << "WA * " << b << endl;
  cout << "TLE * " << c << endl;
  cout << "RE * " << d << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
