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