#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,d1=0,d2=0,d3=0,d4=0;
  	string s;
  	cin >> n;
    for(i=1;i<=n;i++)
    {
    	cin >> s;
      if(s=="AC") d1++;
      if(s=="WA") d2++;
      if(s=="TLE") d3++;
      if(s=="RE") d4++;
    }
  	cout << "AC x " << d1 <<  endl;
  cout << "WA x " << d2 << endl;
  cout << "TLE x " << d3 << endl;
  cout << "RE x " << d4 << endl;
 
}