#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long POW(long long x, long long y) {
  long long ans = 1;
  long long base = x;
  while (y) {
    if (y & 1) {
      ans *= base;
    }
    base = base * base;
    y = y >> 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, i, j, k, t, temp, tc;
  string s[] = {"AC", "WA", "TLE", "RE"};
  string str = "";
  cin >> n;
  long long cnt[4] = {0};
  for (i = 0; i < n; i++) {
    cin >> str;
    for (j = 0; j < 4; j++) {
      if (str == s[j]) {
        cnt[j]++;
        break;
      }
    }
  }
  for (i = 0; i < 4; i++) {
    cout << s[i] << " X " << cnt[i] << endl;
  }
  return 0;
}
