V//aryan_singh
#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
#define FOR0(n) for(ll i=0;i<n;i++)
int main()
{
  ll n,c1=0,c2=0,c3=0,c4=0;
  cin>>n;
  
  for(int i=0;i<n;i++)
  {
      string r;
      cin>>r;
      
      if(r=="AC")
      {
          c1++;
      }
      else if(r=="WA")
      {
          c2++;
      }
      else if(r=="TLE")
      {
          c3++;
      }
      else
      {
          c4++;
      }
  }
      
      cout<<"AC"<<" "<<"x"<<" "<<c1<<endl;
       cout<<"WA"<<" "<<"x"<<" "<<c2<<endl;
        cout<<"TLE"<<" "<<"x"<<" "<<c3<<endl;
         cout<<"RE"<<" "<<"x"<<" "<<c4<<endl;
  }
  return 0;
}