#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string s[a];
  for (int i = 0; i < a; i++) {
    cin >> s[i];
  }
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < a; i++) {
    if (s[i] == "AC")
      AC++;
    else if (s[i] == "WA")
      WA++;
    else if (s[i] == "TLE")
      TLE++;
    else if (s[i] == "RE")
      RE++;
  }
  cout << "AC X " << AC << endl;
  cout << "WA X " << WA << endl;
  cout << "TLE X " << TLE << endl;
  cout << "RE X " << RE << endl;
}
