#include <bits/stdc++.h>
using namespace std;
string get_bin(long long int n) {
  string s = "";
  while (n > 0) {
    s += ('0' + n % 2);
    n /= 2;
  }
  reverse(s.begin(), s.end());
  return s;
}
long long int bin_to_dec(string s) {
  long long int ans = 0;
  for (auto ch : s) {
    ans *= 2;
    ans += (ch - '0');
  }
  return ans;
}
void PrintVector(vector<int> v, int n) {
  for (int i = 0; i < n; i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int no_of_primeFactors(int n) {
  int count = 0;
  while (n % 2 == 0) {
    count++;
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      count++;
      n = n / i;
    }
  }
  if (n > 2) count++;
  return count;
}
long long int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(int a, int b) { return (a / gcd(a, b) * b); }
long long int pwr(long long int base, long long int expo, long long int m) {
  if (base == 0) return 0LL;
  if (expo == 0) return (1LL % m);
  if ((expo & 1) == 0) {
    long long int temp = pwr(base, expo >> 1, m);
    return (temp * temp) % m;
  }
  return ((base % m) * pwr(base, expo - 1, m)) % m;
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "TLE")
      tle++;
    else if (s == "WA")
      wa++;
    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;
}
