#include <iostream>
#include <string>
using namespace std;
long n;
string s[100000];
int main()
{
	cin >> n;
  	for ( i = 0 ; i < n ; i++ ) 
    {
      	cin >> s;
      	if ( s == "AC" ) a++;
      	else if ( s == "WA" ) b++;
      	else if ( s == "TLE" ) c++;
      	else d++;
    }
  	cout << "AC x " << a << endl << "WA x " << b << endl << "TLE x " << c << endl << "RE x " << d;
}