#include <iostream>
#incluede <string>

using namespace std;

int main() {
	int n, a, w, t, r;
    n = a = w = t = r = 0;
  	string str;
    cin >> n;
    while (n-- > 0) {
    	cin >> str;
      	if (str == "AC") {
        	a++;
        } else if (str == "WA") {
        	w++;
        } else if (str == "TLE") {
        	t++;
        } else if (str == "RE") {
        	r++;
        }
    }
  	cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}