#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
bool comp(pair<long long, long long>& a, pair<long long, long long>& b) {
  if (a.second == b.second)
    return a.first > b.first;
  else
    return b.second < a.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int ac = 0, wa = 0, tle = 0, re = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else if (s == "RE")
      re++;
  }
  cout << "AC "
       << "X " << ac << endl;
  cout << "WA "
       << "X " << wa << endl;
  cout << "TLE "
       << "X " << tle << endl;
  cout << "RE "
       << "X " << re << endl;
  return 0;
}
