#include<iostream>
#include<string>
using namespace std;
int main()
  {
  int n, j=0,k=0,g=0,m=0;
string s;
string s1="AC";
string s2="WA";
string s3="TLE";
string s4="RE";
  cin>>n;
//if(n>=1 && n<=100000){
    for(int i=0;i<n;i++)
    {
      cin>>s;
      if(s=="AC")
        j++;
   else if(s=="WA")
     k++;
     else if(s=="TLE")
       g++;
      else 
        m++;
    }
    cout<<"AC x "<<j<<"\n";
  cout<<"WA x "<<k<<"\n";
     cout<<"TLE x "<<g<<"\n";
    cout<<"RE x "<<m<<"\n";
}
return 0;
}
