#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238L;
int fac[2000005] = {0};
void factorial() {
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i < 200005; i++)
    fac[i] = ((i % 1000000007) * (fac[i - 1] % 1000000007)) % 1000000007;
}
int power(int n, int m) {
  int p = 1;
  if (m == 0) return 1;
  p = (power(n, m / 2) % 1000000007);
  p = (p % 1000000007 * p % 1000000007) % 1000000007;
  return (m & 1 ? ((p % 1000000007 * n % 1000000007) % 1000000007)
                : (p % 1000000007));
}
int ncr(int n, int r) {
  return ((fac[n] * power(fac[r], 1000000007 - 2)) % 1000000007 *
          power(fac[n - r], 1000000007 - 2)) %
         1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  long long ac = 0, wa = 0, tle = 0, re = 0;
  while (t--) {
    string second;
    cin >> second;
    if (second == "AC") ac++;
    if (second == "WA") wa++;
    if (second == "TLE") tle++;
    if (second == "RE") re++;
  }
  cout << "AC"
       << " "
       << "X"
       << " " << ac << "\n";
  cout << "WA"
       << " "
       << "X"
       << " " << wa << "\n";
  cout << "TLE"
       << " "
       << "X"
       << " " << tle << "\n";
  cout << "RE"
       << " "
       << "X"
       << " " << re << "\n";
  return 0;
}
