#include<bits/stdc++.h>
using namespace std;
int main()
{
  int t;
  cin>>t;
  string s;
  int cAC = 0;
  int cRE = 0;
  int cTLE = 0;
  int cWA = 0;
  while(t--)
  {
    cin>>s;
    if( s.compare("AC") == 0 )
    {
      cAC++;
      continue;
    }
    if(s.compare("TLE") == 0)
      {
      cAC++;
      continue;
    }
    if(s.compare("WA") == 0)
     {
      cWA++;
      continue;
    }
    if(s.compare("RE") == 0)
     {
      cRE++;
      continue;
    }
  }
  
  cout<<"AC"<<" "<<x<<" "<<cAC<<"\n";
  cout<<"WA"<<" "<<x<<" "<<cWA<<"\n";
  cout<<"TLE"<<" "<<x<<" "<<cTLE<<"\n";
  cout<<"RE"<<" "<<x<<" "<<cRE;
      
    