#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int n, c0=0, c1=0, c2=0, c3=0;
	cin >> n;
    str s;
	for (int i = 0; i < n; i++) {
        cin >> s;
		if(s=="AC") c0++;
        if(s=="WA") c1++;
        if(s=="TLE") c2++;
        if(s=="RE") c3++;
	}
	cout << "AC x " << c0 << endl;
    cout << "WA x " << c1 << endl;
    cout << "TLE x " << c2 << endl;
    cout << "RE x " << c3 << endl;
}
