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

int main()
{
  	int n; cin >> n;
  	map<string,int> freq;
 	freq["AC"] = 0;
  	freq["WA"] = 0;
  	freq["TLE"] = 0;
  	freq["RE"] = 0;
  	for (int = 0; i < n; i++)
    {
    	string s;
      	cin >> s;
      	freq[s]++;
    }
  	for (auto i = freq.begin(); i != freq.end(); i++)
    {
    	cout << i->fi << " x " << i->se << endl;
    }
	return 0;
}
