#include <bits/stdc++.h>
using namespace std;
void printSet(int vS) {
  printf("S = %2d = ", vS);
  stack<int> st;
  while (vS) st.push(vS % 2), vS /= 2;
  while (!st.empty()) printf("%d", st.top()), st.pop();
  printf("\n");
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  string s;
  int a = 0, b = 0, c = 0, d = 0;
  while (n--) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else if (s == "RE")
      d++;
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << b << endl;
  cout << "TLE X " << c << endl;
  cout << "RE X " << d << endl;
}
