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

int main() {
	int n;
	cin>>n;
	map<string> m;
	m["AC"]; m["WA"];m["TLE"];m["RE"];
	for(int i=0;i<n;i++){
	    string t;
	    getline(cin,t);
	    m[t]++;
	}
	cout<<"AC"<<" x "<<m["AC"];
	cout<<"WA"<<" x "<<m["WA"];
	cout<<"TLE"<<" x "<<m["TLE"];
	cout<<"RE"<<" x "<<m["RE"];
	return 0;
}