#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count_AC = 0, count_WA = 0, count_TLE = 0, count_RE = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC")
      count_AC++;
    else if (s == "WA")
      count_WA++;
    else if (s == "TLE")
      count_TLE++;
    else if (s == "RE")
      count_RE++;
  }
  cout << "AC X " << count_AC << "\n";
  cout << "WA X " << count_WA << "\n";
  cout << "TLE X " << count_TLE << "\n";
  cout << "RE X " << count_RE << "\n";
}
