#include <bits/stdc++.h>
using namespace std;
int main() {
  int test, m = 0, j = 0, k = 0, l = 0;
  cin >> test;
  for (int i = 0; i < test; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      m++;
    }
    if (s == "WA") {
      j++;
    }
    if (s == "TLE") {
      k++;
    }
    if (s == "RE") {
      l++;
    }
  }
  cout << "AC *" << m << endl;
  cout << "WA *" << j << endl;
  cout << "TLE *" << k << endl;
  cout << "RE *" << l << endl;
}
