#include <bits/stdc++.h>
using namespace std;
int main() {
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int c4 = 0;
  int n;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == "AC") c1 = c1 + 1;
    if (arr[i] == "WA") c2 = c2 + 1;
    if (arr[i] == "TLE") c3 = c3 + 1;
    if (arr[i] == "RE") c4 = c4 + 1;
  }
  cout << "AC X " << c1 << endl;
  cout << "WA X " << c2 << endl;
  cout << "TLE x " << c3 << endl;
  cout << "RE X " << c4 << endl;
  return 0;
}
