#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, n, w = 0, x = 0, y = 0, z = 0;
  string a = "AC";
  string b = "WA";
  string c = "TLE";
  string d = "RE";
  string word[1000];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> word[i];
  }
  for (i = 0; i < n; i++) {
    if (a == (word[i])) {
      w++;
    } else if (b == (word[i])) {
      x++;
    } else if (c == (word[i])) {
      y++;
    } else if (d == (word[i])) {
      z++;
    }
  }
  cout << "AC "
       << " x " << w << "\n"
       << "WA "
       << " x " << x << "\n"
       << "TLE "
       << " x " << y << "\n"
       << "RE "
       << " x " << z << "\n";
  return 0;
}
