#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n;
  cin>>n;
  int ac=0;
  int wa=0;
  int tle=0;
  int re=0;
  string s;
  for(int i=0;i<n;i++)
  {cin>>s;
   if(s=='AC')
     ac++;
   else if(s=='WA')
     wa++;
   else if(s=='TLE')
     tle++;
   else
     re++;

  }
  cout<<"AC x "<<ac<<endl;
  cout<<"WA x "<<wa<<endl;
  cout<<"TLE x "<<tle<<endl;
  cout<<"RE x "<<re<<endl;
}