#include<iostream>
#include<string>
int main()
{
  int n,c1=0,c2=0,c3=0,c4=0,i;
  string s1 = "AC";
  string s2 = "WA";
  string s3 = "TLE";
  string s4 = "RE";
  string s;
  cin>>n;
  for(i=0;i<n;i++)
  {
    cin>>s;
    if (s=="AC")
    {
      c1++;
    }
    else if (s=="WA")
    {
      c2++;
    }
    else if (s=="TLE")
    {
      c3++;
    }
    else
    {
      c4++;
    }
  }
  cout<<s1<<" x "<<c1<<endl;
  cout<<s2<<" x "<<c2<<endl;
  cout<<s3<<" x "<<c3<<endl;
  cout<<s4<<" x "<<c4<<endl;
  return 0;
}
  