#include <bits/stdc++.h>
using namespace std;
unordered_map<string, int> mp;
int main() {
  int i, j;
  int n;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  scanf("%d", &n);
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC X " << mp["AC"] << "\n";
  cout << "WA X " << mp["WA"] << "\n";
  cout << "TLE X " << mp["TLE"] << "\n";
  cout << "RE X " << mp["RE"] << "\n";
  return 0;
}
