#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
template <class T>
T ABS(const T& x) {
  return x > 0 ? x : -x;
}
long long int gcd(long long int n1, long long int n2) {
  return n2 == 0 ? ABS(n1) : gcd(n2, n1 % n2);
}
long long int lcm(long long int n1, long long int n2) {
  return n1 == 0 && n2 == 0 ? 0 : ABS(n1 * n2) / gcd(n1, n2);
}
long long int ceil2(long long int a, long long int b) {
  return (a + b - 1) / b;
}
map<string, int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < (n); ++i) {
    cin >> s;
    ans[s]++;
  }
  cout << "AC X " << ans["AC"] << "\n";
  cout << "WA X " << ans["WA"] << "\n";
  cout << "TLE X " << ans["TLE"] << "\n";
  cout << "RE X " << ans["RE"] << "\n";
  return 0;
}
