#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> mp;
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  if (mp.find("AC") != mp.end())
    cout << "AC X " << mp["AC"] << endl;
  else
    cout << "AC X 0" << endl;
  if (mp.find("WA") != mp.end())
    cout << "WA X " << mp["WA"] << endl;
  else
    cout << "WA X 0" << endl;
  if (mp.find("TLE") != mp.end())
    cout << "TLE X " << mp["TLE"] << endl;
  else
    cout << "TLE X 0" << endl;
  if (mp.find("RE") != mp.end())
    cout << "RE X " << mp["RE"] << endl;
  else
    cout << "RE X 0" << endl;
  return 0;
}
