#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c,ac=0,wa=0,tl=0,re=0;
  string x,y;
  vector<string> v;
  cin>>a;
  b=a;
  while(b--)
  {cin>>x;
   v.push_back(x);
  }
  for(auto i:v)
  {
    if(i=="AC") ac++;
     if(i=="WA") wa++;
     if(i=="TLE") tl++;
     if(i=="RE") re++;
  }
  cout<<"AC x "<<ac<<endl;
  cout<<"WA x "<<wa<<endl;
  cout<<"TLE x "<<tl<<endl;
  cout<<"RE x "<<re<<endl;
  return 0;
