#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int GCD(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  return GCD(b, a % b);
}
int main() {
  long long int n;
  cin >> n;
  long long int cnt_ac = 0, cnt_wa = 0, cnt_tle = 0, cnt_re = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      cnt_ac++;
    else if (s == "WA")
      cnt_wa++;
    else if (s == "TLE")
      cnt_tle++;
    else
      cnt_re++;
  }
  cout << "AC"
       << " "
       << "X"
       << " " << cnt_ac << endl;
  cout << "WA"
       << " "
       << "X"
       << " " << cnt_wa << endl;
  cout << "TLE"
       << " "
       << "X"
       << " " << cnt_tle << endl;
  cout << "RE"
       << " "
       << "X"
       << " " << cnt_re << endl;
}
