#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(a, b) : a; }
map<string, int> ss;
int main() {
  ss.clear();
  int n;
  cin >> n;
  string s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    ss[s]++;
  }
  cout << "AC * " << ss["AC"] << endl;
  cout << "WA * " << ss["WA"] << endl;
  cout << "TLE * " << ss["TLE"] << endl;
  cout << "RE * " << ss["RE"] << endl;
  system("pause");
  return 0;
}
