#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t, n, i, j, k, l, l1;
  cin >> t;
  long long s1 = 0, s2 = 0, s3 = 0, s4 = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s == "AC")
      s1++;
    else if (s == "WA")
      s2++;
    else if (s == "TLE")
      s3++;
    else
      s4++;
  }
  cout << "AC X " << s1 << "\n";
  cout << "WA X " << s2 << "\n";
  cout << "TLE X " << s3 << "\n";
  cout << "RE X " << s4 << "\n";
}
