#include<iostream>
using namespace std;

int main()
{
  int n;
  cin>>n;
  
  char s;
  char a,b,c,d;
  int e,f,g,h;
  
  a="AC";
  b="WA";
  c="TLE";
  d="RE";
  
  for(int i=0;i<n;i++)
  {
    cin>>s;
    
    if(s==a)
      e++;
    else if(s==b)
      f++;
    else if(s==c)
      g++;
    else
      h++;
  }
  
  cout<<a<<" x "<<e<<endl;
  cout<<b<<" x "<<f<<endl;
  cout<<c<<" x "<<g<<endl;
  cout<<d<<" x "<<h<<endl;
  
  
  
  return 0;}