#include<iostream>
#include<cstring>
using namespace std;
typedef long long int ll;
int main()
{
  ll t;
  string s;
  cin>>t;
  while(t--)
  {
    ll a[4]={0};
    cin>>s;
    if(s=="AC")
      a[0]++;
    else if(s=="WA")
      a[1]++;
    else if(s=="TLE")
      a[2]++;
    else if(s=="RE")
      a[3]++;
    else
      ;
  }
  cout<<"AC x "<<a[0]<<"\n";
  cout<<"WA x "<<a[1]<<"\n";
  cout<<"TLE x "<<a[2]<<"\n";
  cout<<"RE x"<<a[3]<<"\n";
  return 0;
}  