#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<string, int> x;
  while (n--) {
    string s;
    cin >> s;
    x[s]++;
  }
  cout << "AC X " << x["AC"] << endl;
  cout << "WA X " << x["WA"] << endl;
  cout << "TLE X " << x["TLE"] << endl;
  cout << "RE X " << x["RE"] << endl;
}
