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