#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long> prefix_function(string s) {
  long long n = (long long)s.length();
  vector<long long> pi(n);
  for (long long i = 1; i < n; i++) {
    long long j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
  }
  return pi;
}
void solve() {
  long long n;
  cin >> n;
  map<string, long long> m;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << endl;
  cout << "WA X " << m["WA"] << endl;
  cout << "TLE X " << m["TLE"] << endl;
  cout << "RE X " << m["RE"] << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
