#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793;
const long long mod = 998244353;
const long long INF = (long long)(1e9 + 7);
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
int main() {
  long long t;
  cin >> t;
  long long cnt = 0;
  long long ac = 0, wa = 0, re = 0, tle = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "WA") wa++;
    if (s == "TLE") tle++;
    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;
}
