#include <bits/stdc++.h>
const long long int m = 1000000007;
#pragma GCC optimization("O3")
using namespace std;
int main() {
  int t;
  cin >> t;
  map<string, int> m;
  vector<string> st({"AC", "WA", "TLE", "RE"});
  while (t--) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (int i = 0; i < st.size(); ++i) {
    cout << st[i] << " * " << m[st[i]] << "\n";
  }
}
