#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> result;
  vector<string> S;
  result.push_back("AC");
  result.push_back("WA");
  result.push_back("TLE");
  result.push_back("RE");
  int N;
  int a = 0, b = 0, c = 0, d = 0;
  cin >> N;
  string word;
  for (int i = 0; i < N; i++) {
    cin >> word;
    S.push_back(word);
  }
  vector<string>::iterator it;
  for (it = S.begin(); it != S.end(); it++) {
    if (*it == result[0]) a++;
    if (*it == result[1]) b++;
    if (*it == result[2]) c++;
    if (*it == result[3]) d++;
  }
  cout << result[0] << " * " << a << endl << result[1] << " * " << b << endl;
  cout << result[2] << " * " << c << endl << result[3] << " * " << d << endl;
  return 0;
}
