#include <bits/stdc++.h>
using namespace std;
int main() {
  string t[10000], a = "AC", b = "WA", c = "TLE", d = "RE";
  int N;
  int ca = 0, cb = 0, cc = 0, cd = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> t[i];
    if (t[i] == a) {
      ca++;
    } else if (t[i] == b) {
      cb++;
    } else if (t[i] == c) {
      cc++;
    } else if (t[i] == d) {
      cd++;
    }
  }
  cout << a << " x " << ca << endl;
  cout << b << " x " << cb << endl;
  cout << c << " x " << cc << endl;
  cout << d << " x " << cd;
  return 0;
}
