#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, n, ans, c1, c2, c3, c4;
  string s;
  cin >> n;
  i = 0;
  c1 = 0;
  c2 = 0;
  c3 = 0;
  c4 = 0;
  while (i < n) {
    cin >> s;
    if (s == "AC") {
      c1++;
    }
    if (s == "WA") {
      c2++;
    }
    if (s == "TLE") {
      c3++;
    }
    if (s == "RE") {
      c4++;
    }
    i++;
  }
  cout << "AC"
       << " * " << c1 << endl;
  cout << "WA"
       << " * " << c2 << endl;
  cout << "TLE"
       << " * " << c3 << endl;
  cout << "RE"
       << " * " << c4 << endl;
  return (0);
}
