#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> res;
  while (n--) {
    string t;
    cin >> t;
    res[t]++;
  }
  cout << "AC x " << res["AC"] << endl;
  cout << "WA x " << res["WA"] << endl;
  cout << "TLE x " << res["TLA"] << endl;
  cout << "RE x " << res["RE"] << endl;
  return 0;
}
