#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, n;
  string s;
  map<string, long long> m;
  cin >> n;
  i = 0;
  while (i < n) {
    cin >> s;
    m[s]++;
    i++;
  }
  cout << "AC"
       << " * " << m["AC"] << endl;
  cout << "WA"
       << " * " << m["WA"] << endl;
  cout << "TLE"
       << " * " << m["TLE"] << endl;
  cout << "RE"
       << " * " << m["RE"] << endl;
  return (0);
}
