#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  int n;
  vector<int> v(4, 0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      v[0]++;
    else if (s == "WA")
      v[1]++;
    else if (s == "TLE")
      v[2]++;
    else
      v[3]++;
  }
  cout << "AC * " << v[0];
  cout << "\nWA * " << v[1];
  cout << "\nTLE * " << v[2];
  cout << "\nRE * " << v[3];
  return 0;
}
