#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int C0, C1, C2, C3;
  string s1 = "AC";
  string s2 = "WA";
  string s3 = "TLE";
  string s4 = "RE";
  string str;
  int count[4] = {0};
  for (int i = 0; i < n; i++) {
    cin >> str;
    if (str == s1) {
      count[0]++;
    }
    if (str == s2) {
      count[1]++;
    }
    if (str == s3) {
      count[2]++;
    }
    if (str == s4) {
      count[4]++;
    }
  }
  cout << s1 << "x" << count[0] << endl;
  cout << s2 << "x" << count[1] << endl;
  cout << s3 << "x" << count[2] << endl;
  cout << s4 << "x" << count[3] << endl;
}
