#include <iostream>
using namespace std;
#include<bits/stdc++.h>
int main() {
	int n;
	cin>>n;
	vector<string>m(4,0);
	while(n--){
	    string s;
	    cin>>s;
	    m[s]++;
	}
	cout<<"AC"<<" "<<"x"<<" "<<m["AC"];
	cout<<"WA"<<" "<<"x"<<" "<<m["WA"];
	cout<<"TLE"<<" "<<"x"<<" "<<m["TLE"];
	cout<<"RE"<<" "<<"x"<<" "<<m["RE"];
	return 0;
}
