#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a = 0, t = 0, r = 0, w = 0;
  cin >> n;
  while (n--) {
    string str;
    cin >> str;
    if (str[0] == 'A') {
      a++;
    } else if (str[0] == 'W') {
      w++;
    } else if (str[0] == 'T') {
      t++;
    } else {
      r++;
    }
  }
  cout << "AC * " << a << endl;
  cout << "WA * " << w << endl;
  cout << "TLE * " << t << endl;
  cout << "RE * " << r << endl;
  return 0;
}
