#include <bits/stdc++.h>
using namespace std;
int main() {
  string current[4]{"AC", "WA", "TLE", "RE"};
  int n;
  string d[10000];
  int a = 0;
  int b = 0;
  int c = 0;
  int e = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    if (d[i] == current[0]) {
      a = a + 1;
    }
    if (d[i] == current[1]) {
      b = b + 1;
    }
    if (d[i] == current[2]) {
      c = c + 1;
    }
    if (d[i] == current[3]) {
      e = e + 1;
    }
  }
  cout << current[0] << " x " << a << endl;
  cout << current[1] << " x " << b << endl;
  cout << current[2] << " x " << c << endl;
  cout << current[3] << " x " << e << endl;
  system("pause");
}
