#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC")
      c1++;
    else if (s == "WA")
      c2++;
    else if (s == "TLE")
      c3++;
    else
      c4++;
  }
  cout << "AC X " + to_string(c1) << '\n';
  cout << "WA X " + to_string(c2) << '\n';
  cout << "TLE X " + to_string(c3) << '\n';
  cout << "RE X " + to_string(c4) << '\n';
  return 0;
}
