#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << "[" << *it << ": " << a << "]\t";
  err(++it, args...);
}
void solver() {
  long long n;
  cin >> n;
  map<string, long long> mp;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC"
       << " X " << mp["AC"] << '\n';
  cout << "WA"
       << " X " << mp["WA"] << '\n';
  cout << "TLE"
       << " X " << mp["TLE"] << '\n';
  cout << "RE"
       << " X " << mp["RE"] << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solver();
  return 0;
}
