#include <bits/stdc++.h>
using namespace std;
long long powd(long long a, long long b) {
  if (b == 1) {
    return a;
  }
  if (b % 2 == 1) {
    return powd(a, b - 1) * a;
  } else {
    long long x = powd(a, b / 2);
    return x * x;
  }
}
long long powm(long long a, long long b, long long m) {
  if (b == 0) {
    return 1;
  }
  if (b == 1) {
    return a % m;
  }
  if (b % 2 == 1) {
    return ((powm(a, b - 1, m) % m) * (a % m)) % m;
  } else {
    long long x = powm(a, b / 2, m);
    return ((x % m) * (x % m)) % m;
  }
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b, a % b);
}
long long a[10];
int main() {
  int n;
  scanf("%d", &n);
  string s;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'A') {
      a[0]++;
    } else if (s[0] == 'W') {
      a[1]++;
    } else if (s[0] == 'T') {
      a[2]++;
    } else {
      a[3]++;
    }
  }
  cout << "AC"
       << " X " << a[0] << endl;
  cout << "WA"
       << " X " << a[1] << endl;
  cout << "TLE"
       << " X " << a[2] << endl;
  cout << "RE"
       << " X " << a[3];
  return 0;
}
