#include <iostream>

using namespace std;

int main()
{
	int n, C0 = 0, C1 = 0, C2 = 0, C3 = 0;
	cin>>n;
	string o;
	for ( int i = 0; i < n ; i++ )
     {
          cin>>o;
          if ( o == "AC" )
               C0 += 1;
          else if ( o == "WA" )
               C1 += 1;
          else if ( o == "TLE" )
               C2 += 1;
          else
               C3 += 1;
     }
     cout<<"Ac"<<" "<<"x"<<" "<<C0<<endl;
     cout<<"WA"<<" "<<"x"<<" "<<C1<<endl;
     cout<<"TLE"<<" "<<"x"<<" "<<C2<<endl;
     cout<<"RE"<<" "<<"x"<<" "<<C3<<endl;
    return 0;
}
