#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0, t2 = 0, t3 = 0, t4 = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      t++;
    else if (s == "TLE")
      t2++;
    else if (s == "WA")
      t3++;
    else if (s == "RE")
      t4++;
  }
  cout << "AC * " << t << endl;
  cout << "WA * " << t3 << endl;
  cout << "TLE * " << t2 << endl;
  cout << "RE * " << t4 << endl;
  return 0;
}
