#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long lcm(long long a, long long b) {
  return ((long long)a * b / (long long)gcd(a, b));
}
long long comb(long long a, long long b) {
  long long x = max(a - b, b), ans = 1;
  for (long long K = a, L = 1; K >= x + 1; K--, L++) {
    ans *= K;
    ans /= L;
  }
  return ans;
}
void task() {
  int t, ac = 0, wa = 0, tle = 0, re = 0;
  string s;
  cin >> t;
  while (t--) {
    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 << "\n";
  cout << "WA X " << wa << "\n";
  cout << "TLE X " << tle << "\n";
  cout << "RE X " << re << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  task();
  return 0;
}
