#include <bits/stdc++.h>
using namespace std;

int main() {
  int n; 
  cin >> n;
  int arr[] = {0, 0, 0, 0};
  string str;
  while(cin >> str) {
    if (str == 'AC') {
      (arr[0])++;
    }
    if (str == 'WA') {
      (arr[1])++;
    }
    if (str == 'TLE') {
      (arr[2])++;
    }
    if (str == 'RE') {
      (arr[3])++;
    }
  }
  
  cout << "AC x " << arr[0] << endl;
  cout << "WA x " << arr[1] << endl;
  cout << "TLE x " << arr[2] << endl;
  cout << "RE x " << arr[3] << endl;

  return 0;
}