#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int N;
  cin >> N;
  map<string, int> m;
  while (N--) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << "\n";
  cout << "WA X " << m["WA"] << "\n";
  cout << "TLE X " << m["TLE"] << "\n";
  cout << "RE X " << m["RE"] << "\n";
  return 0;
}
