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