#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300 + 5;
bool a[MAXN][MAXN];
int main() {
  int n;
  string s;
  int a[4] = {0};
  cin >> n;
  while (n--) {
    cin >> s;
    if ("AC" == s)
      a[0]++;
    else if ("WA" == s)
      a[1]++;
    else if ("TLE" == s)
      a[2]++;
    else
      a[3]++;
  }
  cout << "AC*" << a[0] << endl;
  cout << "WA*" << a[1] << endl;
  cout << "TLE*" << a[2] << endl;
  cout << "RE*" << a[3] << endl;
  return 0;
}
