#include<iostream>
#include<string.h>
using namespace std;
int main()
{
  int c1=0,c2=0,c3=0,c4=0,n;
  cin>>n;
  string ch;
  while(n!=0)
  {
    cin>>ch;
    if(ch=="AC")
      c1++;
    else if(ch=="WA")
      c2++;
    else if(ch=="TLE")
      c3++;
    else
      c4++;
  }
  cout<<"C"<< <<'x'<< <<c1<<endl;
  cout<<"WA"<< <<'x'<< <<c2<<endl;
  cout<<"TLE"<< <<'x'<< <<c3<<endl;
  cout<<"RE"<< <<'x'<< <<c4<<endl;
}