# include <iostream>
using namespace std;
 
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n=0,a[4]={0};
  cin>>n;
  char ch;
  for(int i=0;i<n;i++)
  {
    cin>>ch;
    if(ch="AC")
      a[0]++;
    else if(ch="WA")
      a[1]++;
    else if(ch="TLE")
      a[2]++;
    else
      a[3]++;
  }
  cout<<"AC"<<" "<<"x"<<" "<<a[0]<<endl;
  cout<<"WA"<<" "<<"x"<<" "<<a[1]<<endl;
  cout<<"TLE"<<" "<<"x"<<" "<<a[2]<<endl;
  cout<<"RE"<<" "<<"x"<<" "<<a[3]<<endl;
  return 0;
}