#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string p;
  vector<string> v;
  for (int i = 0; i < n; i++) {
    cin >> p;
    v.push_back(p);
  }
  string s = "AC";
  cout << s << " ";
  cout << "X"
       << " ";
  cout << count(v.begin(), v.end(), s) << "\n";
  s = "WA";
  cout << s << " ";
  cout << "X"
       << " ";
  cout << count(v.begin(), v.end(), s) << "\n";
  s = "TLE";
  cout << s << " ";
  cout << "X"
       << " ";
  cout << count(v.begin(), v.end(), s) << "\n";
  s = "RE";
  cout << s << " ";
  cout << "X"
       << " ";
  cout << count(v.begin(), v.end(), s);
  cout << "\n";
}
