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

#define in_fre freopen("redir.txt", "r", stdin);
#define out_fre freopen("out5.txt", "w", stdout);
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define debug(i) printf("\nDebug %d\n",i);
#define mod 1000000007
#define ll long long int

int main()
{	
clock_t begin, end;
double time_spent;
begin = clock();
int n;
cin>>n;
int a=0,b=0,c=0,d=0;
for(int i=0;i<n;i++)
{
	string st;
  cin>>st;
  if(st=='AC')
    a++;
  else if(st=='WA')
    b++;
  else if(st=='TLE')
    c++;
  else
    d++;
}
  cout<<"AC X "<<a<<"\n";
  cout<<"WA X "<<a<<"\n";
  cout<<"TLE X "<<a<<"\n";
  cout<<"RE X "<<a<<"\n";


end = clock();
time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
cerr<<"Time spent = "<<time_spent<<endl;

return 0;
}