#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 1, OO = 1e18;
const int di[] = {1, -1, 0, 0};
const int dj[] = {0, 0, 1, -1};
long long TC, n, x, y, cnt, arr[N];
bool f, vis[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  string s;
  map<string, int> make_pair;
  while (n--) {
    cin >> s;
    make_pair[s]++;
  }
  cout << "AC X " << make_pair["AC"] << "\n";
  cout << "WA X " << make_pair["WA"] << "\n";
  cout << "TLE X " << make_pair["TLE"] << "\n";
  cout << "RE X " << make_pair["RE"] << "\n";
  return 0;
}
