#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, a = 0, w = 0, t = 0, r = 0;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "AC") {
      a++;
    } else if (s == "WA") {
      w++;
    } else if (s == "TLE") {
      t++;
    } else {
      r++;
    }
    cout << "AC "
         << "x " << a << "\n";
    cout << "WA "
         << "x " << w << "\n";
    cout << "TLE "
         << "x " << t << "\n";
    cout << "RE "
         << "x " << r << "\n";
  }
  return 0;
}
