#include <iostream>
#include <string>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    int a=0, w=0, t=0, r=0;
  	for(int i=0; i<n; i++){
      string s;
      cin >> s;
    switch(s){
      case 'AC':
        a++;
        break;
      case 'WA':
        w++;
        break;
      case 'TLE':
        t++;
        break;
      case 'RE':
        r++;
        break;
    }
    cout << "AC x "<< a << endl;
    cout << "WA x "<< w << endl;
	cout << "TLE x "<< t << endl;
 	cout << "RE x "<< r << endl;
}