#include <bits/stdc++.h>
using namespace std;
void doProblem173B() {
  int N;
  cin >> N;
  string a[100010], s[4] = {"AC", "WA", "TLE", "RE"};
  int count[4] = {0};
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] == "AC") {
      count[0]++;
    } else if (a[i] == "WA") {
      count[1]++;
    } else if (a[i] == "TLE") {
      count[2]++;
    } else {
      count[3]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << s[i] << "x" << count[i] << endl;
  }
}
int main(int argc, const char* argv[]) {
  doProblem173B();
  return 0;
}
