#include <bits/stdc++.h>
using namespace std;
long long int mod(long long int x, long long int m) { return (x % m + m) % m; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1, r, n, a, d, c, b, x, y, sum, cnt, i, j, k, m, l, q, maxx,
                minn, temp, ans, flag, g, ts;
  long long int mod = 1000000007;
  char ch, chh;
  double dans;
  string str, ttr;
  for (ts = 1; ts <= t; ts++) {
    flag = 0;
    sum = 0;
    cnt = 0;
    ans = 0;
    k = 0;
    maxx = 0;
    minn = 0;
    a = 0;
    b = 0;
    temp = 0;
    cin >> n;
    while (n--) {
      cin >> str;
      if (str == "AC")
        flag++;
      else if (str == "WA")
        sum++;
      else if (str == "TLE")
        cnt++;
      else
        ans++;
    }
    cout << "AC X " << flag;
    cout << "\n";
    cout << "WA X " << sum;
    cout << "\n";
    cout << "TLE X " << cnt;
    cout << "\n";
    cout << "RE X " << ans;
    cout << "\n";
  }
  return 0;
}
