#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> m;
  for (int i = 1; i <= n; i++) {
    string temp;
    cin >> temp;
    m[temp]++;
  }
  cout << "AC X " << m["AC"] << "\n"
       << "WA X " << m["WA"] << "\n"
       << "TLE X " << m["TLE"] << "\n"
       << "RE X " << m["RE"];
}
