#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a,w,t,r;
  vector<string>v(n);
  for(int i=0;i<n;++i)
  {v.push_back(v[i]);}
  for(int i=0;i<n;++i)
  {
    if(v[i]=='AC')
      a++;
    if(v[i]=='WA')
      
      w++;
      
      if(v[i]=='TLE')
        t++;
        if(v[i]=='RE')
          r++;
  }
  cout<<"AC"<<"X"<<a<<endl;
  cout<<"WA"<<"X"<<w<<endl;  
  cout<<"TLE"<<"X"<<t<<endl;  
  cout<<"RE"<<"X"<<r<<endl;
  
 
  return 0;
}
