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