#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  map<string, long long> mp;
  for (long long i = 0; i < n; i++) {
    string str;
    cin >> str;
    mp[str]++;
  }
  cout << "AC X " << mp["AC"] << "\n";
  cout << "WA X " << mp["WA"] << "\n";
  cout << "TLE X " << mp["TLE"] << "\n";
  cout << "RE X " << mp["RE"] << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
