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