#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string s;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  for (int i = 0; i < t; i++) {
    cin >> s;
    if (s == "AC")
      c1++;
    else if (s == "WA")
      c2++;
    else if (s == "TLE")
      c3++;
    else
      c4++;
  }
  for (int i = 0; i < t; i++) {
    cout << "AC x " << c1 << "\n";
    cout << "WA x " << c2 << "\n";
    cout << "TLE x " << c3 << "\n";
    cout << "RE x " << c4 << "\n";
  }
}
