#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  cin.get();
  string arr[N];
  for (int i = 0; i < N; i++) getline(cin, arr[i]);
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  for (int j = 0; j < N; j++) {
    if (arr[j] == "AC") c0++;
    if (arr[j] == "WA") c1++;
    if (arr[j] == "TLE") c2++;
    if (arr[j] == "RE") c3++;
  }
  cout << "AC X " << c0 << endl;
  cout << "WA X " << c1 << endl;
  cout << "TLE X " << c2 << endl;
  cout << "RE X " << c3 << endl;
}
