#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> q;
  string s;
  string s2 = "AC";
  string s3 = "WA";
  string s4 = "TLE";
  string s5 = "RE";
  for (int i = 0; i < n; i++) {
    cin >> s;
    q[s]++;
  }
  cout << "AC X " << q[s2] << endl;
  cout << "WA X " << q[s3] << endl;
  cout << "TLE X " << q[s4] << endl;
  cout << "RE X " << q[s5] << endl;
}
