#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  pair<string, int> p[4];
  p[0].first = "AC";
  p[1].first = "WA";
  p[2].first = "TLE";
  p[3].first = "RE";
  for (int i = 0; i < 6; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < 4; j++) {
      if (p[j].first == s) p[j].second++;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << p[i].first << " x " << p[i].second << endl;
  }
  return 0;
}
